Recording Test Script With WinRunner

How To Use a Wizard to Record a Test Script With WinRunner

If you have a script that you want to convert with WinRunner, you can use the DataDriver Wizard to transform the script into a test that is driven by data. For instance, if you want your test script to include things such as checkpoints or various statements, you could use the DataDriver Wizard. It is not necessary for these items to be repeated with numerous data sets. All you would need to do is set the parameters for the parts of the test script that you wish to run with numerous data sets. To do this, you will want to click on Tools and then DataDriver Wizard.

If you want to transform only a portion of the test into one that is driven by data, you will want to click Cancel. Make a selection of the lines in the script that you want to transform, and open the DataDriver Wizard again. If you choose to transform the whole test into one that is driven by data, you will want to click on the Next option. Once you do this, the Use a new or existing Excel table option should appear. It should show you the Excel file that was generated by WinRunner. This is the file that will store the information for the test. For this exercise, you can just use the default table, or you can use a new name. If you have created a table that you want to reopen, you will want to press the Browse button.

The tables that you create will normally be placed in the test folder. You will now want to look for a box that says "Assign name to variable." You will want to give a name to the data table. If you do not pick a name, the default name will be "table." Once the test starts, the Excel table will be given the value of the table. Within the script, only the name for the variable table will be used. If you decide to use another data table in the future, you will not have to make changes to the entire script. Once you have done this, you will have a number of options available. The first option is to add statements in order to create a test that is data driven.

If you choose this option, statements will be automatically combined in a way that will allow you to run the test within a loop. Braces {} will be added, and the variable name will be set based on what is referenced with the data table. In addition to this, the "ddt_get_row_count" will be added to the test script, and this will allow it to operate in a loop. The "ddt_close" and "ddt_open" statements are equally important, as they will test the script for opening and closing the data table. This will allows rows within the table to be iterated. While these statement can be added automatically, the user has the option of adding them manually if they choose.

If you choose not to use the option offered above, you will be given a warning which states that the test must have a loop if you wish to close and open the data table. The second option for the user is to bring in data from a database. If you choose to use this option, the "ddt_update_from_db" will be added to the test script, as well as the "ddt_save" statement.

To bring in data from a database, you will need to have Microsoft Query on your computer. Data Junction can be useful as well. For those of you who are not familiar with Microsoft Query, it will often be a part of the Microsoft Office Suite. Data Junction will need to be purchased from Mercury Interactive, the company that produces WinRunner. WinRunner is a powerful tool that provides a number of advantages to developers who choose to use it.

Being able to use the Wizard to record a test script is very important, and there are a number of approaches you can use. While some of these approaches may be better than others, they all will essentially achieve the same goal. WinRunner is a powerful tool with various applications.

Editorial Team at Geekinterview is a team of HR and Career Advice members led by Chandra Vennapoosa.

Editorial Team – who has written posts on Online Learning.


Pin It