我正在使用 selenium 运行一些非常简单的测试,一些测试在我的慢速构建机器上随机失败并出现此错误:
com.thoughtworks.selenium.SeleniumException:3000 毫秒后超时
针对此代码:
seleniumStart();
selenium.open("*****");
selenium.waitForPageToLoad("3000");
selenium.type("j_username", LoginTest.DEFAULT_ADMIN_USERNAME );
selenium.type("j_password", LoginTest.DEFAULT_ADMIN_PASSWORD );
selenium.click("loginbutton");
selenium.waitForPageToLoad("3000");
selenium.click("nav_form:managepatients");
它使用 spring security 和 jsf 作为前端。有谁知道为什么会这样?我已经坚持了 2 天。
提前致谢。
最佳答案
3000 毫秒只有 3 秒,有时页面加载时间可能不够,所以也许您只需要提高超时时间? waitForPageToLoad 30000 毫秒似乎更合适。
关于java - selenium.waitForPageToLoad ("3000") 3000 毫秒后超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4897155/