Здравствуйте.
Сегодня решил впервые для себя попробовать selenium на java.
Браузер Google Chrome 57.0.2987.133 (64-bit),
webdriver chrome ChromeDriver 2.29.461591 (62ebf098771772160f391d75e589dc567915b233),
версия Java
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode).
попытался выполнить простейший код
System.setProperty("webdriver.chrome.driver", "C:\\Server\\templates\\selenium\\chromedriver.exe");
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
ChromeOptions options = new ChromeOptions();
//this statement will not show any warnings when you launch chrome
options.addArguments("test-type");
//start a maximized window
options.addArguments("start-maximized");
//this allows you to use a user profile
capabilities.setCapability("chrome.binary", "C:\\Server\\templates\\selenium\\chromedriver.exe");
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
WebDriver driver = new ChromeDriver(capabilities);
и получил ошибку
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:111)
at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32)
at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:302)
at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:146)
Как решить эту проблему?