Print Page | Close Window

Converting Your Test to a Data-Driven Test

Printed From: One Stop Testing
Category: Types Of Software Testing @ OneStopTesting
Forum Name: Web Testing @ OneStopTesting
Forum Discription: Discuss All that is need to be known about Web Testing and its Tools.
URL: http://forum.onestoptesting.com/forum_posts.asp?TID=3462
Printed Date: 21Dec2024 at 11:52am


Topic: Converting Your Test to a Data-Driven Test
Posted By: tanushree
Subject: Converting Your Test to a Data-Driven Test
Date Posted: 31Oct2007 at 3:09am

http://test-techtools.blogspot.com/2007/03/converting-your-test-to-data-driven.html - Converting Your Test to a Data-Driven Test

Start by opening the test you created in Lesson 7 and using the DataDriver Wizard
to parameterize the test.
1 Create a new test from the lesson7 test.
If WinRunner is not already open, choose Programs > WinRunner >
WinRunner on the Start menu. If the Welcome window is open, click the Open
Test button. Otherwise, choose File > Open and select the test you created in
Lesson 7. The lesson7 test opens.
Choose File > Save As and save the test as lesson8 in a convenient location on
your hard drive.
2 Run the DataDriver Wizard.
Choose Tools > DataDriver Wizard. The DataDriver Wizard welcome window
opens. Click Next to begin the parameterization process.
3 Create a data table for the test.
In the Use a new or existing Excel table box, type "lesson8". The DataDriver
Wizard creates an Excel table with this name and saves it the test folder.
4 Assign a table variable name.
Accept the default table variable name, "table".
At the beginning of a data-driven test, the Excel data table you wish to use is
assigned as the value of the table variable. Throughout the script, only the table
variable name is used. This makes it easy for you to assign a different data table
to the script at a later time without making changes throughout the script.
5 Select global parameterization options.
Select Add statements to create a data-driven test. This adds TSL statements
to the test that 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.
Select Parameterize the test and choose the Line by line option. When you
select Parameterize the test, you instruct WinRunner to find fixed values in
recorded statements and selected checkpoints and to replace them with
parameters. 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.
Click Next.
6 Select the data to parameterize.
The first line-by-line screen opens. It refers to the Order Number radio button.
In this test you are going to open a different fax order in each iteration and the
Order Number radio button must be selected each time. Thus, for this script line,
keep the selection, Do not replace this data, and click Next.
The next line by line screen refers to the Order Number edit field. This is the field
you want to change for each iteration. Note that the value, "4" is highlighted and
listed in the Argument to be replaced box to indicate that this is the value
selected for parameterization.
Select A new column under "Replace the selected value with data from:" and
type: Order_Num in the adjacent edit field. The New Column option creates a
column titled "Order_Num" in the lesson8.xls table, and enters the value "4" in
the first row of the column.
Click Next and then click Finish. Your test is parameterized.



Print Page | Close Window