java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V
at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:137)
at org.openqa.selenium.firefox.GeckoDriverService.access$000(GeckoDriverService.java:44)
at org.openqa.selenium.firefox.GeckoDriverService$Builder.usingFirefoxBinary(GeckoDriverService.java:160)
at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:187)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:147)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
at com.testing.YahooTest.testYahoo(YahooTest.java:18)
Yahoo test
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
//import org.openqa.selenium.firefox.FirefoxDriver;
public class YahooTest
{
@Test
public void testYahoo()
{
WebDriver driver = new FirefoxDriver();
driver.get("http://yahoo.com");;
driver.quit();
//assertTrue( true );
}
}
Google test
package com.testing;
//import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class GoogleTest
{
@Test
public void testGoogle()
{
WebDriver driver = new FirefoxDriver();
driver.get("http://Google.com");;
driver.quit();
//assertTrue( true );
}
}
Instructor
Ashish Thakur Replied on 13/11/2018
Please add this guava dependency
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>27.0-jre</version>
</dependency>
?
i update the dependency. Getting error on compile:
after mvn package second screen shot
MVN COMPILE
MVNtest
Instructor
Ashish Thakur Replied on 27/11/2018
Error says - "Multiple versions of ant are detected"
Did you configure ant properly?