Software Testing Social Network

Free Software Testing Tutorial and Quality Assurance Portal

Home Featured Articles Testing Tools HP Mercury Winrunner Winrunner Data Driver Wizard

Winrunner Data Driver Wizard

Once you have successfully debugged and run your test, you may want to see
how the same test performs with multiple sets of data. To do this, you convert your test to a data- driven test and create a corresponding data table with the sets of data you want to test.

Converting your test to a data- driven test involves the following steps:

  • Adding statements to your script that open and close the data table.
  • Adding statements and functions to your test so that it will read from the data table and run in a loop while it applies each set of data.
  • Replacing fixed values in recorded statements and checkpoint statements with parameters, known as Parameterizing the test.
  • You can convert your test to a data- driven test using the DataDriver Wizard or you can modify your script manually.

Creating Data Driven Test:

  • Choose Tools > DataDriver Wizard. Click Next to begin the parameterization process.
  • Create a data table for the test.
  • Assign a table variable name.
  • Select global parameterization options.
  • Select the data to parameterize.
Converting your test to a data- driven test involves the following steps:
  • Adding statements to your script that open and close the data table.
  • Adding statements and functions to your test so that it will read from the data table and run in a loop while it applies each set of data
  • Replacing fixed values in recorded statements and checkpoint statements with parameters, known as Parameterizing the test.
  • You can convert your test to a data- driven test using the DataDriver Wizard or you can modify your script manually.



  Adding Data To The Data Table:

  • Choose Tools > Data Table
  • Add data to the table.
  • Save and close the table.

Winrunner Using Regular Expressions:

The DataDriver wizard finds all fixed values in selected checkpoints and recorded statements, but it does not check for things such as object labels that also may vary based on external input.

To solve this problem, you can use a regular expression. A regular expression is a string that specifies a complex search phrase in order to enable WinRunner to identify objects with varying names or titles.

In this exercise we will use a regular expression in the physical description of the Fax Order window so that WinRunner can ignore variations in the window’s label.

  • Choose Tools > GUI Map Editor
  • Choose View > GUI Files
  • Select the Fax Order No. 4 window icon
  • Modify the window label with a regular expression

 Adding Parameters:

Manually A Test Script can be converted to a Data Driven test.

The procedure for converting a test to a data- driven test is composed of the following main steps:

  • Replacing fixed values in checkpoint statements and in recorded statements with parameters, and creating a data table containing values for the parameters. This is known as parameterizing the test.
  • Adding statements and functions to your test so that it will read from the data table and run in a loop while it reads each iteration of data.
  • Adding statements to your script that open and close the data table.
  • Assigning a variable name to the data table (mandatory when using the DataDriver Wizard and otherwise optional).
Assignment 7             Data Driven Testing
  •  Open Test6
  •  Make it Data Driven
  •  Use regular expression
  •  Add data to the table (1,6,8,10)
  •  Save & run the test
  •  Review the results
  •  Modify your script to accept a Fax No. from the Data Table

Reading Text from an Object


You can read text from any bitmap image or GUI object by adding text checkpoints to a test script. A text checkpoint reads the text from the application. You then add programming elements to the test script, which verify that the text is correct.
For example, you can use a text checkpoint to:
Verify a range of values
Calculate values
Perform certain operations only if specified text is read from the screen

To create a text checkpoint, you indicate the area, object, or window that the text you want to read.
WinRunner inserts a win_get_text or obj_get_text statement into the test script and assigns the text to a variable. To verify the text you add programming elements to the script.

When you want to read text from a standard GUI object (such as an edit field, a list, or a menu), you should use a GUI checkpoint,

Assignment 8             Reading Text:

  •  Start recording in Context Sensitive mode
  •  Check the current No. of orders
  •  Insert a new record
  •  Check whether the record is added or not
  •  Save & run the test
  •  Review the results
Creating Batch Tests:

Using the Batch test one can run any number of Test Cases simultaneously.
 A batch test looks and behaves like a regular test script, except for two main differences:

It contains call statements, which open other tests. For example:
call "c:\\ qa\\ flights\\ lesson9"();
You choose the Run in batch mode option on the Run tab of the General
Options dialog box ( Settings > General Options ) before running the test.


Comments (0)Add Comment

Write comment
You must be logged in to post a comment. Please register if you do not have an account yet.

busy