我刚刚为Selenium WebDriver(a.k.a。Selenium 2)自动测试无头测试创建了一个简单的Maven项目。我加入了PhantomJS驱动程序与依赖pom.xml中的其他依赖如下:如何解决NoClassDefFoundError:CircularOutputStream错误?
<dependency>
<groupId>com.github.detro</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.2.0</version>
</dependency>
但越来越错误:
java.lang.NoClassDefFoundError: org/openqa/selenium/io/CircularOutputStream
at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:60)
at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:56)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)
at jp.co.skygate.home.HomePageLogin.setUp(HomePageLogin.java:108)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
只删除从pom.xml中PhantomJS依赖性解决了这个问题,并它执行得很好。 有人可以帮我找到问题吗?
在此先感谢。
所以,这是版本兼容性问题。你可以在selenium-remote-driver-2.53.0中使用phantomjsdriver 1.3.0 –