Selenium 2 WebDriver NoClassDefFoundErrorS

I am working with Selenium 2 WebDriver in Eclipse and everything is working fine.

But when I want to test my WebDriver test files without Eclipse, many missing classes arise.

First it starts with:

 NoClassDefFoundError com/google/common/collect/Maps 

so I downloaded guava.jar and set the path to it for it.

But now the following NoClassDefFoundError has happened:

 java.lang.NoClassDefFoundError: org/json/JSONException 

Errors always occur on createDriver();

I am running Selenium with JUnit in Java.

"Only for JUnit" -testcases works fine (set the path to junit.jar and selenium-java.jar)

Do you know which banks I have to link in this eclipse are already tied by default for selenium test boxes?

+3
source share
1 answer

Are you using a standalone server to download?

If you download the selenium server package, you will get about 47 cans. I believe that you need all of these banks in your class path to complete. This package can be downloaded from here.

Or a separate package can be downloaded from http://code.google.com/p/selenium/downloads/detail?name=selenium-server-standalone-2.20.0.jar

If you are not using it right now, the easiest solution may be to switch to an offline version; otherwise load the full server and add all the banks in your classpath.

+4
source

Source: https://habr.com/ru/post/953434/


All Articles