import org.openqa.selenium.WebDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
@SuppressWarnings("unused")
public class Test {
public static void main(String[] args) throws Exception {
WebDriver dr = new HtmlUnitDriver(true);
dr.get(Data.strLOGIN_URL);
}
}
错误
Exception in thread "main" java.lang.NoSuchMethodError: com.gargoylesoftware.htmlunit.WebClient.setThrowExceptionOnFailingStatusCode(Z)V
at org.openqa.selenium.htmlunit.HtmlUnitDriver.createWebClient(HtmlUnitDriver.java:160)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.(HtmlUnitDriver.java:108)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.(HtmlUnitDriver.java:149)
at com.iulicai.test.Test.main(Test.java:14)