Tutorials
Testing
An application has to be tested with multiple sets of data. The automation test script written for one input can be used for number of inputs using data driven test in Winrunner. The test script has to be converted into the data driven test by creating a corresponding data table with the sets of data you want to test.
The following steps are involved in converting the test script into the data driven test:
When the option “Add statements to create the test” is selected, the TSL statements will be added to the test the define the table variable name, open and close the data table and run the appropriate script selection in a loop for each row in the data table.
When the option “Parameterize the test” is selected and line-by-line option is selected, the Winrunner finds the fixed values in the recorded statements and selected checkpoints. The line-by-line option instructs the wizard to open a screen for each line of the selected test that can be parameterized so that you can choose whether or not to parameterize that line.
The ddt_open statement opens the table and the subsequent lines confirm that the data-driven test opens successfully.
The ddt_get_row_count statement checks how many rows are in the table and therefore how many iterations of the parameterized section of the test to perform.
The for statement sets up the iteration loop.
The ddt_set_row statement tells the test which row of the table to use on each iteration.
The ddt_close statement closes the table.
After parameterizing the test script, the data, which the parameterized test will use, should be added. The data table can be accessed through the option Tools-> data table. An excel sheet opens up with the column names. Add the required data to the data table and save the table.
Major thing to be considered while dealing with data driver wizard is it does not check for things such as object labels that may also vary based on external input. The wizard only finds the fixed points in the test script.
| can we use oracle as a database to create tables and access that info when doing data driven test rather than an excel sheet...please advice. |