转发新会话时出错无法找到:PhantomJS的功能

时间:2018-06-12 11:57:36

标签: selenium phantomjs remotewebdriver

我收到此错误 转发新会话时出错无法找到:Capabilities {browserName:phantomjs,javascriptEnabled:true,phantomjs.binary.path:D:/Selenium/phantomjs.exe,version:} 当试图使用remotewebdriver浏览PhantomJS浏览器时。 我正在设置网格,

set HERE=%CD%
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_152
set PATH=%JAVA_HOME%\jre\bin;%JAVA_HOME%\bin;%PATH%
set SELENIUM_VERSION=3.12.0
set CHROME_VERSION=chrome-64.0.3282.140
set CHROME_DRIVER_LOC=D:\Selenium\chromedriver.exe
set IE_DRIVER_LOC=D:\Selenium\IEDriverServer.exe
set GECKO_DRIVER_LOC=D:\Selenium\geckodriver.exe
set PHANTOM_DRIVER_LOC=D:\Selenium\phantomjs.exe
set HUB_URL=http://localhost:4444/grid/register
start java -jar selenium-server-standalone-%SELENIUM_VERSION%.jar -role hub
start java -jar selenium-server-standalone-%SELENIUM_VERSION%.jar -role node
-Dwebdriver.chrome.driver= %CHROME_DRIVER_LOC% -hub %HUB_URL% -port 5556
-Dwebdriver.ie.driver= %IE_DRIVER_LOC% -hub %HUB_URL% -port 5557
-Dwebdriver.gecko.driver= %GECKO_DRIVER_LOC% -hub %HUB_URL% -port 5558
%PHANTOM_DRIVER_LOC% --webdriver=5567--webdriver-selenium-grid-hub=http://10.40.242.153:4444

启动PhantomJS的代码是,

driverCapability = DesiredCapabilities.phantomjs();
            driverCapability.setJavascriptEnabled(true);
            driverCapability.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, browserProperties.getString("phantomjs_binary_path"));
            webdriver = new RemoteWebDriver(remoteServerUrl, driverCapability);

帮助请求PLease。

0 个答案:

没有答案