[英]Selenium not finding Google AutoService
I'm just getting started with Selenium, and Selenium can't find Google AutoService (which I assume is included in the Selenium download). 我刚刚开始使用Selenium,Selenium找不到Google AutoService(我假设它已包含在Selenium下载中)。
I'm definitely including all Selenium JARs on the classpath. 我肯定会在类路径中包括所有Selenium JAR。
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Test
{
public static void main(String args[])
{
System.setProperty("webdriver.chrome.driver",
"/path/to/chromedriver");
WebDriver driver = new ChromeDriver();
driver.navigate().to("https://google.com");
}
}
What I have so far should simply navigate to Google (I basically copy-pasted it from some online tutorials). 到目前为止,我所拥有的应该只是导航到Google(我基本上是从一些在线教程中复制粘贴)。 When I compile, I get 当我编译时,我得到
...Selenium\client-combined-3.141.59-
sources.jar(/org/openqa/selenium/chrome/ChromeDriverService.java):100:
error: cannot find symbol
@AutoService(DriverService.Builder.class)
^
symbol: class AutoService
location: class ChromeDriverService
I faced the same problem two months ago. 两个月前我遇到了同样的问题。
A genius developped a library to provide updated WebDrivers: WebDriverManager 一个天才开发了一个库来提供更新的WebDrivers: WebDriverManager
Code example here 这里的代码示例
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.