Quality Testing

Quality is delighting customers

Check item is present in an listbox? if it is present then select it?

Hi frnds can you please share some code to the above question.

Views: 300

Reply to This

Replies to This Discussion

1.First count no of items in the list box using GetItemcount function and based on count use a for loop and try to getitem(loopvariable) and check whether the value is correct or not

var=browser().page().weblist().getroproperty("items count")

print var

var1=browser().page().weblist().getroproperty("all items")

print var1

for i = 1 to var

var2=browser().page().weblist().get items(i)

if var2="item present in ur list box"

browser().page().weblist().set var2

end if


as it is a weblist object, use 'Select' method to click on the given item


TTWT Magazine





© 2021   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service