02-03-2010, 04:04 PM
Hi Ankur,
I am Sireesha. I got a doubt regarding how to write script to select an item from Flights table based on Fly From and Fly To selection criteria.
I have parameterized Fly From and Fly To values, Flight table list items and entered values in Data Table. But based on the Fly From and Fly To selection in flight table some list items will be displayed.But in Data Table i can give only one value(but that is also not recognized by QTP while running becoz of random population of list items in Flights table)
I wrote following script but i am getting errors. Please help me on this regard.
Plz tell me where ever modifications required. i donno much on Vb script.
Thanks in advance.
I am Sireesha. I got a doubt regarding how to write script to select an item from Flights table based on Fly From and Fly To selection criteria.
I have parameterized Fly From and Fly To values, Flight table list items and entered values in Data Table. But based on the Fly From and Fly To selection in flight table some list items will be displayed.But in Data Table i can give only one value(but that is also not recognized by QTP while running becoz of random population of list items in Flights table)
I wrote following script but i am getting errors. Please help me on this regard.
Code:
Dim i, introwcount
InvokeApplication("D:\HP\QuickTest Professional\samples\flight\app\flight4a.exe")
Dialog("Login").WinEdit("Agent Name:").Set "training"
Dialog("Login").WinEdit("Agent Name:").Type micTab
Dialog("Login").WinEdit("Password:").SetSecure "4b6840b3fe5f9a3c3048beca56289b582c098a99"
Dialog("Login").WinButton("OK").Click
introwcount=Datatable.GetRowCount()
For i=1 To introwcount
Window("Flight Reservation").ActiveX("MaskEdBox").Type "110211"
Window("Flight Reservation").WinComboBox("Fly From:").Select DataTable("fly_from", dtGlobalSheet)
Window("Flight Reservation").WinComboBox("Fly To:").Select DataTable("fly_to", dtGlobalSheet)
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select DataTable("List", dtGlobalSheet)
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "siri"
Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").WinButton("Button").Click
Datatable.SetNextRow
Next
Plz tell me where ever modifications required. i donno much on Vb script.
Thanks in advance.