这是我的 Selenium 浏览器测试类(派生类,但应该不难理解它在做什么)。当我运行测试用例时,所有交互都按预期发生。但最终测试用例的结果显示失败。
package dmswebui.CR;
import org.infineta.webui.selenium4j.MainTestCase;
public class TestLogin extends MainTestCase {
@Override
public void setUp() throws Exception {
super.setUp();
startSeleniumSession("ChromeDriver", "http://192.168.8.207/");
}
public void testMethod() throws Exception {
session().open("/");
session().type("name=user","admin");
session().type("name=password","infineta123");
session().click("id=btnLogin-button"); session().waitForPageToLoad("30000");
session().click("id=btnUserLogout-button");
session().click("id=yui-gen0-button"); session().waitForPageToLoad("30000");
}
public void tearDown() throws Exception {
super.tearDown();
closeSeleniumSession();
}
}
我得到的错误是:
Testcase: testMethod took 13.939 sec
Caused an ERROR
Error communicating with the remote browser. It may have died.