Badboy Automated Test tool 5 Parametric Add Variable
Badboy provides script parameterization to facilitate automated data flexibility. In this section, we take the parameterization of the group purchase keyword of search Lashou as an example:
One script recording
1. Enter: http://wuxi.lashou.com/ to browser bar
two。 Start recording
3. Enter 12 and click search
4. After the page expands the search results
5. Click back on browser bar to return to http://wuxi.lashou.com/
6. Stop recording, expand the script tree, and click the Variable tab (display Tab step: click View- > Summary View)
Based on the figure above, we can observe that our input ktv has been recorded, and our expectation is that we don't have to design a new script to test other group-buying content.
Script parameterization provides us with a solution
Second, add parameters.
1. Right-click Add Varialbe in Variable Tab and the following window pops up
two。 Enter the variable name "Searchcontent"
3. Since this use case is a test valid class, then we add valid test data, such as × × ×, MTV
4.
Parameterize the values in the script
1. Right-click sw in the script tree and select Properties
two。
Another: when we want to fix a parameter value, we can also use the index usage of Variable list. If I want the script to check ktv every time, it should Value=$ {Searchcontent [0]}, and the index of list starts at 0.
3.
4 set the mode of operation
1. Double-click Step "Variable search", or right-click to select Properties
two。 Set the operation mode to Searchcontent as a loop, and click Ok
3. Select Variable Search to run the script
Observe the operation of the script, search according to the two parameter values entered, and the parameterization is successful.