Error:
java.lang.ClassNotFoundException
Eclipse Error:
While executing my code, getting above error, can anyone please help me on this?
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It only takes a minute to sign up.
Sign up to join this communityError:
java.lang.ClassNotFoundException
Eclipse Error:
While executing my code, getting above error, can anyone please help me on this?
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
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.
You are trying to create a WebDriver
instance with ChromeDriver
constructor. This is not correct. Change WebDriver
in your code to ChromeDriver
.
ChromeDriver
implements WebDriver
, so creating a WebDriver
instance with new ChromeDriver()
is perfectly valid. (It is odd that the class name is Firefoxbrowser, though…)
Jan 24, 2018 at 21:14