What is QTP script to find whether perticular city in weblist in web page or not?

Questions by sureshkadiri

Showing Answers 1 - 4 of 4 Answers


  • Feb 25th, 2008

Chkcity=Browser("").Page("").Weblist("").Select "Cityname"
If Chkcity="True'
   Reporter.ReportEvent micPass. "Checking the city name in Weblist",
                       "CITYEXISTED IN THE LISTBOX"
   Reporter.ReportEvent micPass. "Checking the city name in Weblist",
                       "CITYEXISTED NOT IN THE LISTBOX"

Try this. I think I answerd your query

  Was this answer useful?  Yes


  • Jun 18th, 2015

How to write test cases for country to city navigation drop down lists?

  Was this answer useful?  Yes


  • Aug 7th, 2015

cityName = "Delhi"
DropDownCityNames = browser("title:=.*").page("title:=.*").weblist("name:=city").GetRoProperty("all items")
ArDropDownCityNames = split(DropDownCityNames,";")
For each x in ArDropDownCityNames
if x = cityName then
msgbox cityName & " is present in the dropdown"
browser("title:=.*").page("title:=.*").weblist("name:=city").select cityName
end if
I think this answers your question


  • Aug 16th, 2016

just an easy
set obj = description.Create()
obj("html tag").value="SELECT"
obj("index").value =
Browser("title:=.*").page("title:=.*").WebList(obj).Select "DELHI"

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions