Pages

Tuesday, September 14, 2010

How To Parameterize Radio Button

Go to Flight Reservation Window-->start recording for “New Order” the below lines of script is generated
image
Window("Flight Reservation").Activate
Window("Flight Reservation").WinMenu("Menu").Select "File;New Order"
Window("Flight Reservation").ActiveX("MaskEdBox").Type "121210"
Window("Flight Reservation").WinComboBox("Fly From:").Select "London"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Los Angeles"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "mohit"
Window("Flight Reservation").WinRadioButton("First").Set
Window("Flight Reservation").WinEdit("Tickets:").Set "3"
Window("Flight Reservation").WinButton("Insert Order").Click
Step 2:
To parameterize the radio button
Go to object repository -->the below window opens -->click on first--> click on the symbol -->It opens the second window--> enter column name--> select “location in data table -->click on “OK”
clip_image005clip_image007
We can see the below change in QT
clip_image009
Enter the three values in data table under column name “Tickets_Types ” as
First
Economy
Business
NOTE:- all the above names of the radio buttons should be given in the same way as given the Flight Reservation Page “Case-sensitive” other wise QT won’t recognize and generates a run time error as
clip_image011try giving radio button name “First” as “first” and see .
Now run and see .It will execute the script for all the three values one at a time giving us three different iterations in “Results “
clip_image013