我从servlet调用Junit测试用例。
我添加了所有必需的JAR文件。我为exe设置了正确的路径。当我将驱动程序更改为Firefox时,它工作正常。我希望测试套件能够在无头浏览器上运行。我正在使用Tomcat 8服务器来运行Web应用程序。
javax.servlet.ServletException: Servlet execution threw an exception
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause -
java.lang.NoClassDefFoundError:
org/openqa/selenium/browserlaunchers/Proxies
org.openqa.selenium.phantomjs.PhantomJSDriverService.createDefaultService(PhantomJSDriverService.java:178)
org.openqa.selenium.phantomjs.PhantomJSDriver.<init>(PhantomJSDriver.java:99)
异常
titleLabel.adjustsFontSizeToFitWidth to true