【发布时间】:2017-05-02 08:29:32
【问题描述】:
我正在尝试在 selenium-java 中编写我的第一个程序,但是在几行的简短程序中,我遇到了以下错误:
线程 "main" java.lang.IllegalAccessError 中的异常:试图从类 org.openqa.selenium.firefox.FirefoxBinary 访问类 org.openqa.selenium.os.ExecutableFinder 在 org.openqa.selenium.firefox.FirefoxBinary.locateFirefoxBinariesFromPlatform(FirefoxBinary.java:418) 在 org.openqa.selenium.firefox.FirefoxBinary.(FirefoxBinary.java:108) 在 java.util.Optional.orElseGet(未知来源) 在 org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:204) 在 org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:108) 在 org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:104) 在 com.packt.selenium.chapter1.NavigateToAUrl.main(NavigateToAUrl.java:12)
我的代码是:
package com.packt.selenium.chapter1;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class NavigateToAUrl
{
public static void main(String[] args)
{
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
}
}
【问题讨论】:
标签: selenium