10-16-2012, 04:08 PM
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
Exit For
else
Msgbox "Failed"
End If
Next
Next
This is my code .... here the prblm is if a= "beer" it should select and exit the loop
I am able to select but i am not able to exit frm loop
help me....