Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Selecting values from drop down using QTP.
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Is this what you are looking at?

Code:
StrAllItems = Split(Browser("...:=...").Page("..:=..").Frame("..:=..").WebList("..:=..").GetRoProperty("All Items"),";")

For intCounter = Lbound(strAllItems) to Ubound(strAllItems)
   If Browser("...:=...").Page("..:=..").Frame("..:=..").WebList("..:=..").GetItem(intCounter) = "SomeValue" Then
            Browser("...:=...").Page("..:=..").Frame("..:=..").WebList("..:=..").Select (intCounter)
            Exit For
          Else
              msgbox "value not found...Please write a reporter event for this"
         End If      

Next

Or

Code:
iTemCount = Split(Browser("...:=...").Page("..:=..").Frame("..:=..").WebList("..:=..").GetRoProperty("Items Count")

For intCounter = 0 to iTemCount - 1
        If Browser("...:=...").Page("..:=..").Frame("..:=..").WebList("..:=..").GetItem(intCounter) = "SomeValue" Then
            Browser("...:=...").Page("..:=..").Frame("..:=..").WebList("..:=..").Select (intCounter)
            Exit For
          Else
              msgbox "value not found...Please write a reporter event for this"
         End If      

Next
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Messages In This Thread
RE: Selecting values from drop down using QTP. - by basanth27 - 02-25-2013, 06:55 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need to verify the drop down values based on condition santhoshmscsoftware 1 2,905 05-04-2016, 11:28 PM
Last Post: supputuri
  QTP not selecting appropriate webelement from the webtable..Need Solution satishkumarm 11 21,626 03-23-2016, 12:47 PM
Last Post: Swetha_Bayya
  Drag and drop issue excellentpawan123 0 2,744 01-13-2015, 05:04 PM
Last Post: excellentpawan123
  Drop down list class is a link thotamurali 2 4,171 08-22-2014, 05:48 PM
Last Post: thotamurali
Question How to do the QTP drag and drop between two different java objects? ioanaalm 4 8,011 05-23-2014, 03:34 PM
Last Post: excellentpawan123

Forum Jump:


Users browsing this thread: 2 Guest(s)