上午,公司网速超级慢,连内网都很慢,什么破网络啊,真郁闷,然后使用selenium测试时,一直报超时,很郁闷,后来上网上找了找,http://www.codeproject.com/Messages/3351419/Getting-This-Error-Selenium-SeleniumException-Time.aspx
原因是:
selenium默认每个命令响应时间是30秒。即使你等待100秒(该语句selenium.waitForPageToLoad("30000");),如果30秒内没响应,也会报这样的错误。所以要把它默认的命令timeout时间设置大于你要等待的时间,selenium.setTimeout();如selenium.setTimeout("600000");