Selenium timeout

上一篇 / 下一篇  2010-04-29 13:59:02 / 个人分类:Selenium

在使用SELENIUM RC进行测试时,总是会发现在打开网页的过程中TIMEOUT 30000MS的错误提示.

这是因为打开网页时有一个默认的超时限制,更改这个默认值的命令是:

selenium.set_timeout("60000")

这个值最好是放在SetUP方法中.

Some comments:

  • You don't need a wait_for_page_to_load after an open, that will cause you timeouts because once the page is loaded after the opeen, it will start waiting again and the page will not be loading.
  • Most of the failures you get from selenium (timeouts, object not found) can be caught with try-except statements
  • You should set the timeout in your tests withing the test itself (using set_timeout), that way it doesn't depend on the way you start the server, it will always wait the time you wanted

TAG: Selenium selenium timeout

 

评分:0

我来说两句

Open Toolbar