Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Read next datatable rather than login again
#4
Solved: 12 Years, 10 Months, 3 Weeks ago
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,

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
Next

Thanks
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
Reply


Messages In This Thread
RE: Read next datatable rather than login again - by KVK - 10-26-2010, 06:44 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Want to read the data from excel and set read value in the JavaTable rajeevk7 0 2,747 07-10-2017, 04:20 PM
Last Post: rajeevk7
Exclamation Login & logout in Siebel and clicking pop-up button yuetling926 7 12,251 07-09-2014, 10:43 PM
Last Post: hhamilton
  Unable to Click on Login Button Paurav 1 3,725 07-03-2014, 05:27 AM
Last Post: supputuri
  for help.Run a test to login,and then it didn't jump to another page maosilu 0 2,889 11-01-2013, 01:27 PM
Last Post: maosilu
  Datatable add and datatable import sheet wheelercha 4 34,289 06-14-2012, 04:53 PM
Last Post: Arul

Forum Jump:


Users browsing this thread: 1 Guest(s)