-1

Error:

java.lang.ClassNotFoundException

Eclipse Error:

enter image description here

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

3
  • 1
    Does your path point to the correct location for the Selenium classes?
    – Kate Paulk
    Jan 24, 2018 at 15:36
  • 3
    Please copy-paste the text of the error message, not a screenshot with it!
    – Embedded
    Jan 24, 2018 at 20:26
  • I have the same problem but I am not using maven dependencies. How do I solve my error because I am quite new to this platform Feb 28, 2020 at 14:58

3 Answers 3

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.

-2

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

1
  • 3
    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, 2018 at 21:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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