Selenium Webdriver + Java – Eclipse: java.lang.NoClassDefFoundError

java.lang.NoClassDefFoundError is observed when the JRE can’t find a Class.

In simple words the required imports or jar files are not available. From the snapshot you have shared its pretty much evident that you have tried to add the Java Client related jars.

In this case you need to follow the following steps:

  1. Remove all the jars referring to previous versions of Selenium standalone server & Selenium Java client
  2. Import only the selenium-server-standalone-3.7.0.
  3. In your IDE within Project menu, select the option Build Automatically and execute the Clean option for all of your Projects.
  4. Execute your Test.

Leave a Comment