| || |
Validating data in a DropDown List
I have a web application, countries are displayed in a dropdown window which is a web list.
I need to validate that web application is displaying all countries are not. I did use following descriptive program, but it did not work. Can you please help me in this.
Set oDesc = Description.Create()
oDesc("micclass").Value = "WebList"
oDesc("Index").Value = "4"
Set country = Browser("Registration").Page("Registration").Child Objects(oDesc)
For i = 1 to country.Count
DataTable.Value("File_1", dtGlobalsheet) = country(i-1).GetRoproperty("value")
Set oDesc = Nothing
Thank you in advance,
Re: Validating data in a DropDown List
You want to be referencing the contents of the weblist, the description object setup you have now is trying to find multiple weblists that match the specified description object on the page, not their content.
Or you can go the easier route and just reference Weblist().Getitem(i)
Or an even more efficient method - Do a GetROProperty on 'all items', format your expected results in the same string format. Then just do an exact comparison of the two and skip the looping. Not like the expected results of a country list are changing very often. Then all that code just becomes:
a = ...Weblist().GetROProperty("all items")
If a = expectedCountries then pass