How to fix NoClassDefFoundError: CircularOutputStream error?

落爺英雄遲暮 提交于 2019-12-05 13:40:34

At last I got the solution.

Adding PhantomJS v.1.2.0 replaces the selenium-remote-driver-2.53.0.jar with selenium-remote-driver-2.41.0.jar and hence breaks down everything. And now using V.2.41.0,

driver = new FirefoxDriver();

instead of

driver = new PhantomJSDriver(caps);

generates the error.

As per @Ripon comment, the problem is in version compatibility, so Selenium Server 2.53.x should be used along with Phantom JS 1.3.x .

Here is lines in the pom.xml which should work:

<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-java</artifactId>
  <version>2.53.1</version>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>com.codeborne</groupId>
  <artifactId>phantomjsdriver</artifactId>
  <version>1.3.0</version>
</dependency>

Then run mvn dependency:tree to build and display the dependency tree for this project.

If you're not using Maven, you need to make sure you've all dependent jar files in your classpath.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!