Active TopicsActive Topics  Display List of Forum MembersMemberlist  CalendarCalendar  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin


 One Stop Testing ForumTesting Tools @ OneStopTestingWinRunner @ OneStopTesting

Message Icon Topic: Data Driven Tests using WinRunner

Post Reply Post New Topic
Author Message
soumali
Newbie
Newbie
Avatar

Joined: 02Apr2007
Online Status: Offline
Posts: 34
Quote soumali Replybullet Topic: Data Driven Tests using WinRunner
    Posted: 13Jun2007 at 12:43am
Data Driven Tests using WinRunner:

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.

Steps involved in creating data driven tests:

The following steps are involved in converting the test script into the data driven test:

   1. Adding statements to your script that open and close the data table.
   2. Adding statements and functions to the test so that it will read from the data table and run in a loop while it applies each set of data.
   3. Replacing the fixed values in the recorded statements and checkpoint statements with parameters, known as parameterizing the test.

The Data Driver Wizard contains the following features

   1. The data table.
   2. The name of the variable used to refer to the data table.
   3. Different options used to convert the test script into the data driven test script.

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 following elements are added to the data driver test script:

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.

Adding Data to the Data 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.

In order to overcome the above problem, “Regular expression” is used. 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. The object labels name has to be changed with a general value in the GUI map editor.

The data driven test can be run now for multiple number of test data. Thus data driven test can be used when the application has to be tested for a number of input data.




Post Resume: Click here to Upload your Resume & Apply for Jobs

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 1.875 seconds.
Vyom is an ISO 9001:2000 Certified Organization

© Vyom Technosoft Pvt. Ltd. All Rights Reserved.

Privacy Policy | Terms and Conditions
Job Interview Questions | Placement Papers | Free SMS | Freshers Jobs | MBA Forum | Learn SAP | Web Hosting