When I executing the following code:
public static void main(String[] args) {
try {
FirefoxDriver driver = new FirefoxDriver();
driver.get("http:www.yahoo.com");
} catch (NoClassDefFoundError ex) {
System.out.println("error: " + ex.getStackTrace());
}
}
I'm facing the following error:
error:[Ljava.lang.StackTraceElement;@80f4cb
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Function
Could someone help me to find the solution or reason for this?
I had the same problem, and finally I found that I forgot to add the selenium-server-standalone-version.jar. I had only added the client jar, selenium-java-version.jar.
I encountered the same error and after the investigation, I found that library selenium-api 2.41.0 requires guava 15.0 but it was overridden by an older version so I declared guava 15.0 as a direct dependency by adding following configuration in pom.xml:
I got the same error, but it was resolved if you add the libraries of selenium (again if you haven't), if you are using INTELIJ
Same needs to be done for other IDE's as well, like eclipse.
pattern :
Note download gecko from here :- http://docs.seleniumhq.org/download/
It looks like you're trying to import some google code:
And it's not finding it the class Function. Check to make sure all the required libraries are in your build path, and that you typed the package correctly.
I had the same issue. I found that I forgot to add selenium-2.53.0/selenium-java-2.53.0-srcs.jar file to my project's Reference library.