Search This Blog

Friday, January 7, 2011

Script to Count No. of Items in a List Box & Display theie names.

This sample script uses mercury Flight Reservation site & count number of items in list box "From Day" & display their name one by one.

 
  • SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe", "http://newtours.demoaut.com/"
  • Dim list_count
  • Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set "test"
  • Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("password").SetSecure "4cb4513bfbdc1da7fa533425cf4f"
  • Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Image("Sign-In").Click
  • list_count=Browser("Find a Flight: Mercury").Page("Find a Flight: Mercury").WebList("fromDay").getroproperty("items count")
  • msgbox list_count
  • For i = 1 to list_count
  • Item_Name = Browser("Find a Flight: Mercury").Page("Find a Flight: Mercury").WebList("fromDay").getitem(i)
  • msgbox Item_Name
  • Next

No comments:

Post a Comment