0
我正在尝试利用phantoJS在无头模式下运行我的硒测试。对于我做以下,PhantomJSDriverService不被eclipse识别
DesiredCapabilities caps = new DesiredCapabilities();
caps.setJavascriptEnabled(true);
caps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY,
"path/to/your/phantomjs.exe"
);
出于某种原因PhantomJSDriverService被强调为在Eclipse错误。我无法使用PhantomJSDriverService中的点符号来调用PHANTOMJS_EXECUTABLE_PATH_PROPERTY。
我会做什么错?如果它没有意义,会解释更多。
'由于某种原因,PhantomJSDriverService在eclipse中被加下划线错误Eclipse会告诉你什么是错误的,将鼠标悬停在编辑器左边的错误图标上并检查消息,如[ ](https://i.stack.imgur.com/AlTNx.png) – BackSlash
你的构建路径中是否有phantomjsdriver.jar? – Grasshopper
错误消息显示“PhantomJSDriverService无法解析为变量” @Grasshopper,我认为我们不需要将phantomjsdriver.jar放入构建路径中。我在下面的行中提供phantomjs.exe的位置 caps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, “path/to/your/phantomjs.exe” ); – Chuchoo