Setting weightage values
You can set weightage values for an item type to determine how often the value of that item type can be displayed in the generated test data.
Before you begin
- You must have a project and a schema.
- You must have created a weightage file that can be of CSV or Microsoft Excel
Open XML format.Note: The weightage file consists of one column for values of item types and another column for weightage values for each item type value. The weightage values must be integers.
About this task
- When HCL® OneTest™ Data processes a large amount of data.
- When there is a large difference between the weightage values.
The probability of occurrence of any item type value in the generated test data can be computed by using the following formula:
Probability of occurrence of any item type value = Weight of each item type value / Total weight of all the item type values
The following table shows an example when you have a weightage file with five item type values and its corresponding weightage values:
Item type values | Weightage values |
---|---|
Red | 50000 |
Blue | 5000 |
Green | 500 |
Orange | 50 |
Purple | 5 |
The total weightage value of all the item type values = 50000 + 5000 + 500 +
50 + 5 = 55555
.
The probability of occurrence of each item type value in the generated test data can be computed as shown in the following table:
Item type values | Probability of occurrence | Computed values |
---|---|---|
Red | 50000/55555 | 0.9 |
Blue | 5000/55555 | 0.09 |
Green | 500/55555 | 0.009 |
Orange | 50/55555 | 0.0009 |
Purple | 5/55555 | 0.00009 |
From the computed values, Red has a higher probability value than other colors.
When you use this weightage file to set the weightage value for any specific item type and generate the test data, then you can find the generated test data with more occurrences of Red as compared to the other colors.
Procedure
- Log in to HCL OneTest™ Server and open the team space that contains your project.
-
Open your project.
The Overview page is displayed.
-
Click
. The Data Fabrication page is displayed.
- Click Files and import the weightage file from the local file system into your project.
- Open your schema from the Schemas tab.
- Select the item type on which you want to apply the weightage value.
- Select Restrictions from the Item Properties drop-down list of the Properties dialog.
- Enable the Values from file toggle button.
- Provide the name of the weightage file in the Values file field.
- Enter the column number in Values column number and Weights column number.
- Click Save.
- Select the group and generate the test data.
Results
You can view more occurrences of the values that are set with higher weightage values as a result of the test data generation.
What to do next
You must prepare the structural view of the schema. See Designing a structural view of the schema.