ComgooglecommonbasePreconditionscheckStateZLjavalangStringLjavalangObjectV | Selenium Forum
K
Kam Posted on 13/11/2018
Module 9 Part 3
I ran both test cases YahooTest and Google test as indivual and from mvn test. Both time test cases run sucesfully. Browers Open , launch site and quit. But inreports test cases are fail with an erro


com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V

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 );
}
}



A
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>
?


K
Kam Replied on 16/11/2018

i update the dependency. Getting error on compile:
after mvn package second screen shot


K
Kam Replied on 16/11/2018

MVN COMPILE


K
Kam Replied on 16/11/2018

MVNtest


A
Ashish Thakur Replied on 27/11/2018

Error says - "Multiple versions of ant are detected"
Did you configure ant properly?