05-25-2011, 07:49 PM
hi perplexed, ok, so I will try to help with some ideas
I think you should use a counter for that, I've used in next way:
where obj_DropDown was described before to use it (I think you know how to do that?!):
In my sample the URL is got from an XML file(it's the application's URL, you can insert it directly into the code, and the obj_Name is the name of your dropdown, for e.g.:
P.S. and now play with IF statements to count the under subtree elements and to select the one you want (and to get the sub tree elements from it). Maybe you'll need a second counter for the elements under subtrees?!
Hope that will help you!
I think you should use a counter for that, I've used in next way:
Code:
' get the row's count from the dropdown method
Dim Counter
Counter = obj_DropDown.GetROProperty("items count")
MsgBox "There are '" & Counter & "' items under the dropdown!", 0, "Counter Results!!!
where obj_DropDown was described before to use it (I think you know how to do that?!):
Code:
Set obj_DropDown = Browser("URL:=" & Environment.Value("baseUrl")).Page("URL:=" & Environment.Value("baseUrl")).WebList ("select type:=ComboBox Select", "name:=" & obj_Name)
In my sample the URL is got from an XML file(it's the application's URL, you can insert it directly into the code, and the obj_Name is the name of your dropdown, for e.g.:
Code:
' get the row's count from the dropdown
Dim Counter
Set obj_DropDown = Browser("URL:=http://learnqtp.com/.*").Page("URL:=http://learnqtp.com/.*").WebList ("select type:=ComboBox Select", "name:=" & selectCountryDropDown)
Counter = obj_DropDown.GetROProperty("items count")
MsgBox "There are '" & Counter & "' items under the dropdown!", 0, "Counter Results!!!"
P.S. and now play with IF statements to count the under subtree elements and to select the one you want (and to get the sub tree elements from it). Maybe you'll need a second counter for the elements under subtrees?!
Hope that will help you!