|
我在debug一下代码的时候出现了错误:
import com.thoughtworks.selenium.*;
import org.testng.annotations.*;
import static org.testng.Assert.*;
import java.util.regex.Pattern;
public class sample extends SeleneseTestNgHelper{
Selenium selenium;
@Test public void testUntitled() throws Exception {
selenium=new DefaultSelenium("localhost", 4444, "*firefox", "http://www.swpu.edu.cn");
selenium.open("/");
selenium.click("link=软件学院第三届董事会第一次会议召开");
selenium.waitForPageToLoad("30000");
selenium.click("link=首页");
selenium.waitForPageToLoad("30000");
}
}
错误:
FAILED: testUntitled
com.thoughtworks.selenium.SeleniumException: ERROR Server Exception: sessionId should not be null; has this session been started yet?
at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)
at com.thoughtworks.selenium.DefaultSelenium.open(DefaultSelenium.java:335)
at sample.testUntitled(sample.java:11)
... Removed 22 stack frames
===============================================
sample
Tests run: 1, Failures: 1, Skips: 0 |
|