【发布时间】:2011-10-17 10:00:13
【问题描述】:
我使用的是硒 2.8。我遇到了这样一个疯狂的错误:
testPersistence(com.***.***.selenium.test.PersistenceTest) 已用时间:0.032 秒我的测试类很简单。它有一个像这样的测试:
@Test public void testPersistence() throws InterruptedException { DefaultSelenium selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://localhost:8080"); selenium.start(); selenium.waitForPageToLoad("30000"); selenium.open("/***/register.seam"); selenium.waitForPageToLoad("30000"); selenium.type("registration:username", "jackman"); Thread.sleep(5000); selenium.type("registration:name", "Jack Daniels"); Thread.sleep(5000); selenium.type("registration:password", "123456789"); Thread.sleep(5000); selenium.click("registration:register"); selenium.waitForPageToLoad("30000"); Thread.sleep(5000); assertTrue(selenium.isTextPresent("regexpi:Welcome")); selenium.stop(); }谁能帮帮我?
提前致谢
【问题讨论】:
-
从错误堆栈的顶部,它抱怨它无法启动 selenium。您的环境设置正确吗?您是否启动了 selenium 服务器?您是否添加了所需的依赖项?