Hi,
In such a case I would go about like this:
I hope it helps and is understandable.
In such a case I would go about like this:
Code:
Dim aArray, sArrayItem, nArrayIndex, oBrowserPage, oNewWindow
Set oBrowserPage = Browser("Google").Page("Search")
'Store all items in weblist into an array separated by semi-colon (;)
aArray = oBrowserPage.WebList("lstSampleWebList").GetROProperty("all items")
'Split Weblist items and store in string variable
sArrayItem = Split(aArray,";")
'Run loop until all items have been selected in weblist or exit do statement is executed when value is found
'nArrayIndex=0
Do While nArrayIndex < UBound(aArray)
'Select item in WebList
oBrowserPage.WebList("lstSampleWebList").Select sArrayItem(nArrayIndex)
'Insert code below for the link you want to click after item selection in weblist
oBrowserPage.Link("lnkSampleLink").Click
'New Window opens, set it into an object
oNewWindow = Browser("NewWindow").Page("SearchPage")
'Search your value in the new window
oNewWindow.WebEdit("txtSearchBox").Set sArrayItem(nArrayIndex) 'Value to be searched/looked for. I'm assuming a search box is there.
'Click search button/link
oNewWindow.Link("SearchButton").Click
If oNewWindow.WebEdit("txtValueFound").GetROProperty("text") = sArrayItem(nArrayIndex) Then
'Value found. Show message box and exit Do-While block
msgbox "Value found!"
Exit Do
Else
'Value not found. Close new window and continue loop
oNewWindow.Close
End If
'Increment Array Index so that weblist can select next item.
nArrayIndex = nArrayIndex + 1
End Do
I hope it helps and is understandable.