Karthikeyan082075
Programmer
I have a scenario in my application where i click on a button to go to next page. Some time due to some error message, the application may come back to same page. In this case i need to provide proper info and again click on the button to move forward. I tried using IF...END IF for this and it does not seems to work.
Code snipet
-------------------------------------------------------
Dim obj_button
set obj_button = description.Create
obj_button("html tag").value = "button"
obj_button("name").value = "Find Flights"
Browser("b1").Page("p1").Link(obj_button).Click
wait(10)
If Browser("b1").Page("p1").Exist Then
Browser("b1").Page("p1").Link(obj_button).Click
Browser("b1").Sync ()
else
End If
--------------------------------------------------------
In the code snipet, i click on an object and wait for 10 seconds so that the next page comes up. In spite of the page currently displayed is not "p1" the control is going into the IF structure.
Can some one tell me what is the mistake that i am doing?
Code snipet
-------------------------------------------------------
Dim obj_button
set obj_button = description.Create
obj_button("html tag").value = "button"
obj_button("name").value = "Find Flights"
Browser("b1").Page("p1").Link(obj_button).Click
wait(10)
If Browser("b1").Page("p1").Exist Then
Browser("b1").Page("p1").Link(obj_button).Click
Browser("b1").Sync ()
else
End If
--------------------------------------------------------
In the code snipet, i click on an object and wait for 10 seconds so that the next page comes up. In spite of the page currently displayed is not "p1" the control is going into the IF structure.
Can some one tell me what is the mistake that i am doing?