Selenium 2 WebDriver NoClassDefFoundErrorS

编程入门 行业动态 更新时间:2024-10-27 14:18:40
本文介绍了Selenium 2 WebDriver NoClassDefFoundErrorS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在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 $ b

JUnit 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/Maps

so I downloaded the guava.jar and set the classpath to it.

But now the next NoClassDefFoundError occured:

java.lang.NoClassDefFoundError: org/json/JSONException

The 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

本文发布于:2023-11-24 19:15:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1626486.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Selenium   WebDriver   NoClassDefFoundErrorS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!