How do you look for a value in a dropdown box? The dropdown is dynamic, and if the "hello" is available.. I want to select "Hello".. I know its probably simple, but to me its proving to be quite difficult.
On a side note.. I am the only person in my social/work circle that uses QTP. I would like to view a site with several scripts so I may get a better idea of how others are writing in QTP. Anyone know of a good site to read some scripts?
I specialize in automation. I am fairly new to QTP.
1) Since the dropdown is dynamic, any time you invoke the methods to drop the list, all available items will be there to select. The best advice is to start recording and click the dropdown list and using the code generated by QTP as a template (and this certainly helps in learning how to use QTP).
2) This site is FULL of code that you can learn from - search and you will most definitely find.
If u know the properties of list box u can use following code
If B("B").p("p").WebList(DropDownName).Exist(10) Then
'Retrieve all the items
FullList = B("B").p("p").WebList(DropDownName).GetROProperty( "all items")
'Check if the item is in the list and then select it
If InStr(FullList, ItemValue) > 0 Then
msgbox "value selected"
and please let me know this solution is works for u or not