zqb781192364
2019-03-14 20:00 阅读 678

使用PhantomJSDriver.jar包,运行时报错

报错信息如下:
三月 14, 2019 7:46:00 下午 org.openqa.selenium.phantomjs.PhantomJSDriverService
信息: executable: G:\workspace\phantomjs-2.1.1-windows\bin\phantomjs.exe
三月 14, 2019 7:46:00 下午 org.openqa.selenium.phantomjs.PhantomJSDriverService
信息: port: 3127
三月 14, 2019 7:46:00 下午 org.openqa.selenium.phantomjs.PhantomJSDriverService
信息: arguments: [--webdriver=3127, --webdriver-logfile=G:\workspace\DLPCenter_latest\phantomjsdriver.log]
三月 14, 2019 7:46:00 下午 org.openqa.selenium.phantomjs.PhantomJSDriverService
信息: environment: {}
[INFO - 2019-03-14T11:46:05.188Z] GhostDriver - Main - running on port 3127
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/net/MediaType
at org.openqa.selenium.remote.http.JsonHttpCommandCodec.encode(JsonHttpCommandCodec.java:197)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163)
at org.openqa.selenium.phantomjs.PhantomJSCommandExecutor.execute(PhantomJSCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:572)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:139)
at org.openqa.selenium.phantomjs.PhantomJSDriver.(PhantomJSDriver.java:115)
at org.openqa.selenium.phantomjs.PhantomJSDriver.(PhantomJSDriver.java:104)
at com.tipray.test.EchartsDemoTest.getPhantomJSDriver(EchartsDemoTest.java:102)
at com.tipray.test.EchartsDemoTest.saveSurfModelUrlToImg(EchartsDemoTest.java:53)
at com.tipray.test.EchartsDemoTest.main(EchartsDemoTest.java:48)
Caused by: java.lang.ClassNotFoundException: com.google.common.net.MediaType
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 12 more

仅导入
com.codeborne
phantomjsdriver
1.2.1

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

相关推荐