tags:

views:

40

answers:

1

Hello,

A recorded test script includes a google search.

After clicking on "Google Search", the next action was to click on a link in the test results, however during playback this happens before the browser has loaded the results, so the solution seemed to be to add a delay after the search. I tried it two ways :

  • changing "click" to "clickAndWait" with a value of 1000. This works, badly. The value of 1000 does not change the default value of 30000ms, and the playback takes 30s to complete the step.

  • calling "setTimeout" before the click with a value of 1000. This has no effect on the timeout behavior of clickAndWait.

Here is the script :

open / type q test search setTimeout 1000 clickAndWait btnG 1000 click link=CLEP Test Center Search clickAndWait link=Home

If anyone can advise, thanks very much.

A: 

I would recommend another solution by adding a waitForElementPresent command before clicking the link.

  • open /
  • type q test search
  • click btnG
  • waitForElementPresent link=CLEP Test Center Search
  • click link=CLEP Test Center Search
  • waitForElementPresent link=Home
  • click link=Home

You can find a good explanation in http://www.infoq.com/articles/testing-ajax-selenium

abochan
That got the script working. Thank you very much for your guidance, abochan,
You're welcome, user446660 :)
abochan