I hope this question isn't too general. Well, the situation is that I am testing a web-app and I am ending up having to put these delays with the setSpeed
command. But I'd rather say to it "wait for the page to finish loading", except I can't exactly do that.. because it gets redirected to a page with a random URL.
Here's a sample of it(sorry it looks a bit ugly):
setSpeed 7000
open router2/default.aspx?SID=9795d782-07d9-4fcc-a896-f79e30b2b800&FIRID=10DULKAR&SUMSTAT=1&PID=
setSpeed 700
click xpath=(//input[@name='radio_43'])[2]
setSpeed 4000
clickAndWait id=ctl00_Content_btnContinue
setSpeed 7000
verifyTextPresent Post Qualification Logic
clickAndWait id=ctl00_Content_btnContinue
type name=numeric_42 19
clickAndWait id=ctl00_Content_btnContinue
click xpath=(//input[@name='radio_51'])[5]
clickAndWait id=ctl00_Content_btnContinue
click xpath=(//input[@name='radio_2180'])[4]
clickAndWait id=ctl00_Content_btnContinue
verifyTextPresent Client Survey Entry
That's why I put the 7 second delays in it. but it seems slow/inefficient.
thanks
This depends on if you are using standard HTTP redirection, or javascript/ajax execution. For standard redirection, the 'clickAndWait' commands should suffice without setting any delays. And for ajax execution, use the wait_for_ajax trick as demonstrated here