-2

Error:

java.lang.ClassNotFoundException

Eclipse Error:

enter image description here

While executing my code, getting above error, can anyone please help me on this?

  • 1
    Does your path point to the correct location for the Selenium classes? – Kate Paulk Jan 24 '18 at 15:36
  • 1
    Please copy-paste the text of the error message, not a screenshot with it! – Embedded Jan 24 '18 at 20:26
1

I was also facing the same issue. I've added guava JRE.jar in project

You can refer here https://mvnrepository.com/artifact/com.google.guava/guava/23.6-jre to add maven dependency

OR

Download guava_jre.jar file from http://central.maven.org/maven2/com/google/guava/guava/23.6-jre/ and add it in your project

0

As I can see from the error stacktrace it is caused by the com.google.common.base.Function it means either the jar file is missing or it is not loaded properly. You can try the following.

1. If you are using maven for dependency management I would suggest. Go to the following path C:\users\your_user_id\.m2\repository locate your jar file for which you are getting the error(in your case com/google/commons) delete that folder and rebuild the project and update the maven.

2. If you have added Jar files directly by using configure build path options and remove the dependency and add it again.

-1

You are trying to create a WebDriver instance with ChromeDriver constructor. This is not correct. Change WebDriver in your code to ChromeDriver.

  • 1
    This is incorrect. ChromeDriver implements WebDriver, so creating a WebDriver instance with new ChromeDriver() is perfectly valid. (It is odd that the class name is Firefoxbrowser, though…) – Dale Emery Jan 24 '18 at 21:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.