10-16-2012, 04:22 PM
Put the second exit for after the first next statement
Code:
Browser("Link Express - Booking").Page("Link Express - Booking").Link("Booking").Click
Browser("Link Express - Booking").Page("Link Express - Booking").Link("Create").Click
Browser("Link Express - Booking").Page("Link Express - Booking").WebElement("FMCG Food and Drink Drink").Highlight
Set odesc=Description.Create
odesc("micclass").value="WebElement"
odesc("html tag").value="SPAN"
odesc("class").value="rtPlus"
Set val= Browser("Link Express - Booking").Page("Link Express - Booking").WebElement("FMCG Food and Drink Drink").ChildObjects(odesc)
Msgbox val.count
For i=0 to val.count-50
val(i).highlight
val(i).click
'a=val(i).GetROProperty("innertext")
'Msgbox a
Set odesc1=Description.Create
odesc1("micclass").value="WebElement"
odesc1("html tag").value="SPAN"
odesc1("class").value="rtIn"
Set val1= Browser("Link Express - Booking").Page("Link Express - Booking").WebElement("FMCG Food and Drink Drink").ChildObjects(odesc1)
Msgbox val1.count
For j=0 to val1.count-270
a=val1( j ).GetROProperty("innertext")
Msgbox a
val1(j).Highlight
Ifa="Beer"Then
Msgbox "Beer"
Val1(j).click
Exit For
else
Msgbox "Failed"
End If
Next
Exit For
Next