Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get list items based on selection
#1
Solved: 10 Years, 8 Months, 3 Weeks ago
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.

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.
Reply
#2
Solved: 10 Years, 8 Months, 3 Weeks ago
Hi ,

Try with the below way & execute.

Code:
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select 0

Note: As it would select 1st item in the list for all rows irrespective of flight selection(Fly From & Fly To ) and hence there would be no issues.Smile
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Windows Application Custom Combo box selection change event not firing in uft RamUFT 0 820 02-06-2020, 08:10 AM
Last Post: RamUFT
Sad How To Find Dropdown Object based on Values from the dropdown list mesg2anil 12 32,797 12-19-2017, 10:25 PM
Last Post: sandy2404
  Compare second web list value according to the first web list value roselin6 1 2,632 10-07-2015, 09:14 PM
Last Post: supputuri
  Unable to fetch items from WpfList in UFT saurabhkumar_gupta 0 2,277 03-08-2015, 09:17 PM
Last Post: saurabhkumar_gupta
  Can't locate items on Win7 Desktop RandomGrin 0 1,971 01-30-2015, 10:55 PM
Last Post: RandomGrin

Forum Jump:


Users browsing this thread: 1 Guest(s)