-5

using Testing Version 6.8 StackTrace:

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:124)
    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:339)
    at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123)
    at smartBuild.Utilities.DriverFactory.getDriver(DriverFactory.java:23)
    at smartBuild.tng.RecipeCreationWithReusableWithExcel.openApplicaiton(RecipeCreationWithReusableWithExcel.java:27)
rimonmostafiz
  • 1,341
  • 1
  • 15
  • 33

1 Answers1

0

There must be 2 different versions of the jar. one is getting used when you use eclipse and the other when you run from command prompt the later might not have the method. Basically, the code is compiled with say version 1 and the command prompt has version 2 in the classpath.

  • No I have checked both versions are same... in the class path and in eclipse basically I have copied the jars from eclispe pulgins only – HarshadSaluja Dec 19 '17 at 11:01
  • That's the only reason for a NoSuchMethodError though, when the method is present while compiling and not present while execution. You could either decompile the jar and verify or check in the dependency tree if you are having more than one version of the same artifact while executing. – Pranali Choudhari Dec 20 '17 at 07:22