Я выполняю простую программу java и пытаюсь выполнить мой первый сценарий селена.получение исключения во время выполнения программы веб-драйвера selenium
public static void main(String[] args) {
// Create a new instance of the html unit driver
// Notice that the remainder of the code relies on the interface,
// not the implementation.
WebDriver driver = new HtmlUnitDriver();
// And now use this to visit Google
driver.get("http://www.google.com");
// Find the text input element by its name
WebElement element = driver.findElement(By.name("q"));
// Enter something to search for
element.sendKeys("Cheese!");
// Now submit the form. WebDriver will find the form for us from the element
element.submit();
// Check the title of the page
System.out.println("Page title is: " + driver.getTitle());
driver.quit();
}
эти зависимости, которые я добавил:
Но после выполнения этого кода я получаю это исключение в затмении.
java.lang.ClassNotFoundException: org.apache.xerces.xni.XNIException
Почему у вас есть xerces.jar, я не думаю, что это нужно для запуска сценария селена. Удалите это и попробуйте еще раз. –