Hi,
You can use the below code,
1. Set the test settings as "Run One Iteration Only"
Goto - > Test Settings ->RUN--> Select "Run One Iteration Only"
2. Add Parameters Names(Column names) as given in the code in Global DataTable
3. Add required data in the respective cells in the Global DataTable
Here is the code,
Thanks
Vinod
Hi...
Small correction in the code.. please use the below code,
You can use the below code,
1. Set the test settings as "Run One Iteration Only"
Goto - > Test Settings ->RUN--> Select "Run One Iteration Only"
2. Add Parameters Names(Column names) as given in the code in Global DataTable
3. Add required data in the respective cells in the Global DataTable
Here is the code,
Code:
SystemUtil.Run "D:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe","","D:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"
For i = 1 to DataTable.GetSheet("dtGlobalSheet").GetRowCount ' gets the number of used rows in Global sheet
Dialog("Login").WinEdit("Agent Name:").Set DataTable.Value("Username","dtGlobalSheet")
Dialog("Login").WinEdit("Password:").Set DataTable.Value("Password","dtGlobalSheet")
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").WinObject("Date of Flight:").Type "111110"
Window("Flight Reservation").WinComboBox("Fly From:").Select DataTable.Value("FlyFrom","dtGlobalSheet")
Window("Flight Reservation").WinComboBox("Fly To:").Select DataTable.Value("FlyTo","dtGlobalSheet")
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select "11121 FRA 03:48 PM LON 04:31 PM AA $111.00"
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
NextThanks
Vinod
Hi...
Small correction in the code.. please use the below code,
Code:
SystemUtil.Run "D:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe","","D:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"
For i = 1 to DataTable.GetSheet("dtGlobalSheet").GetRowCount ' gets the number of used rows in Global sheet
DataTable.SetCurrentRow(i) ' sets the position of the row number to get the data from datatable
Dialog("Login").WinEdit("Agent Name:").Set DataTable.Value("Username","dtGlobalSheet")
Dialog("Login").WinEdit("Password:").Set DataTable.Value("Password","dtGlobalSheet")
Dialog("Login").WinButton("OK").Click
Window("Flight Reservation").WinObject("Date of Flight:").Type "111110"
Window("Flight Reservation").WinComboBox("Fly From:").Select DataTable.Value("FlyFrom","dtGlobalSheet")
Window("Flight Reservation").WinComboBox("Fly To:").Select DataTable.Value("FlyTo","dtGlobalSheet")
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select "11121 FRA 03:48 PM LON 04:31 PM AA $111.00"
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Next
