我正在Eclipse中使用 Selenium 2 WebDriver ,一切正常。
但是当我想要在没有Eclipse的情况下测试我的WebDriver TestCases许多缺少的类都会发生。
首先尝试:
NoClassDefFoundError com / google / common / collect / Maps所以我下载了番石榴.jar并设置类路径。
但是现在下一个NoClassDefFoundError发生了:
code> java.lang.NoClassDefFoundError:org / json / JSONException错误总是发生在我在Java中使用JUnit运行Selenium。
$ b $ bJUnit only-testcases工作正常(将classpath设置为junit.jar& selenium-java.jar)
你知道哪个jar我必须绑定在那个eclipse已经绑定为selenium测试用例的默认值?
解决方案您是否使用独立的服务器下载?
如果您下载selenium服务器软件包,您将获得约47个jar。我相信你需要你的类路径中的所有这些jar来执行。该软件包可以从这里
或者可以从 code.google/p/selenium/downloads/detail?name=selenium-server-standalone -2.20.0.jar
如果您现在不使用它,最简单的解决方案可能是切换到独立版本;否则下载完整的服务器&将所有罐子添加到您的类路径。
I'm working with Selenium 2 WebDriver in Eclipse and everything works fine.
But when I want to test my WebDriver Testcases without Eclipse many missing classes occur.
First it startet with :
NoClassDefFoundError com/google/common/collect/Mapsso I downloaded the guava.jar and set the classpath to it.
But now the next NoClassDefFoundError occured:
java.lang.NoClassDefFoundError: org/json/JSONExceptionThe errors always occur on createDriver();
I run the Selenium with JUnit in Java.
"JUnit only"-testcases work fine (set the classpath to junit.jar & selenium-java.jar)
Do you know which jars I have to bind in that eclipse already has bound in as default for the selenium testcases?
解决方案Are you using a standalone server download?
If you download the selenium server package you'll get about 47 jars with it. I believe you need all of those jars in your classpath in order to execute. That package can be downloaded from here
Or the standalone package can be downloaded from code.google/p/selenium/downloads/detail?name=selenium-server-standalone-2.20.0.jar
If you're not using it right now, the easiest solution might be to switch to the standalone version; otherwise download the full server & add all the jars to your classpath.
更多推荐
Selenium 2 WebDriver NoClassDefFoundErrorS
发布评论