I am running simple code in selenium and it throws below exception:-
@Test
public void test(){
System.setProperty("webdriver.chrome.driver", "geckodriver.exe");
WebDriver driver=new FirefoxDriver();
driver.get("https://google.com");
driver.manage().window().maximize();
}
Following error is shown when I have executed my script:
Previously it was working, my firefox version is 55 and i am using latest gecko driver version. Please help!!
Exception is:- 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:136) at org.openqa.selenium.firefox.GeckoDriverService.access$000(GeckoDriverService.java:41) at org.openqa.selenium.firefox.GeckoDriverService$Builder.usingFirefoxBinary(GeckoDriverService.java:108) at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:204) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:103) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:99) at newTab.Tab.test(Tab.java:16) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104) at org.testng.internal.Invoker.invokeMethod(Invoker.java:645) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112) at org.testng.TestRunner.privateRun(TestRunner.java:756) at org.testng.TestRunner.run(TestRunner.java:610) at org.testng.SuiteRunner.runTest(SuiteRunner.java:387) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:382) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340) at org.testng.SuiteRunner.run(SuiteRunner.java:289) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1293) at org.testng.TestNG.runSuitesLocally(TestNG.java:1218) at org.testng.TestNG.runSuites(TestNG.java:1133) at org.testng.TestNG.run(TestNG.java:1104) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)
webdriver.chrome.driver
towebdriver.gecko.driver
– Jainish Kapadia