Selenium Grid正在推出错误版本的Firefox

时间:2016-12-14 23:01:18

标签: selenium selenium-grid

我试图在OS X上使用Selenium Grid 3.0.1和Firefox 47. /Applications/Firefox.app是Firefox 50. /Applications/Firefox 47.app是Firefox 47.无论我尝试什么,Selenium都会启动{ {1}}。

我在集线器模式下运行独立服务器。

/Applications/Firefox.app

然后使用Firefox 47设置节点。

$ java -jar ~/Downloads/selenium-server-standalone-3.0.1.jar -role hub
14:54:03.419 INFO - Selenium build info: version: '3.0.1', revision: '1969d75'
14:54:03.420 INFO - Launching Selenium Grid hub
2016-12-14 14:54:04.042:INFO::main: Logging initialized @946ms
14:54:04.052 INFO - Will listen on 4444
2016-12-14 14:54:04.093:INFO:osjs.Server:main: jetty-9.2.15.v20160210
2016-12-14 14:54:04.120:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@4d49af10{/,null,AVAILABLE}
2016-12-14 14:54:04.141:INFO:osjs.ServerConnector:main: Started ServerConnector@29ba4338{HTTP/1.1}{0.0.0.0:4444}
2016-12-14 14:54:04.142:INFO:osjs.Server:main: Started @1046ms
14:54:04.142 INFO - Nodes should register to http://192.168.1.10:4444/grid/register/
14:54:04.142 INFO - Selenium Grid hub is up and running

我通过$ java -jar ~/Downloads/selenium-server-standalone-3.0.1.jar -role node -browser browserName=firefox,version=47,firefox_binary=/Applications/Firefox\ 47.app/Contents/MacOS/firefox-bin 14:55:14.887 INFO - Selenium build info: version: '3.0.1', revision: '1969d75' 14:55:14.888 INFO - Launching a Selenium Grid node 2016-12-14 14:55:15.470:INFO::main: Logging initialized @854ms 14:55:15.505 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform MAC 14:55:15.505 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped: registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform MAC 14:55:15.506 INFO - Driver class not found: com.opera.core.systems.OperaDriver 14:55:15.506 INFO - Driver provider com.opera.core.systems.OperaDriver registration is skipped: Unable to create new instances on this machine. 14:55:15.506 INFO - Driver class not found: com.opera.core.systems.OperaDriver 14:55:15.506 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered 2016-12-14 14:55:15.535:INFO:osjs.Server:main: jetty-9.2.15.v20160210 2016-12-14 14:55:15.560:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler@481a996b{/,null,AVAILABLE} 2016-12-14 14:55:15.587:INFO:osjs.ServerConnector:main: Started ServerConnector@7714e963{HTTP/1.1}{0.0.0.0:5555} 2016-12-14 14:55:15.587:INFO:osjs.Server:main: Started @971ms 14:55:15.587 INFO - Selenium Grid node is up and ready to register to the hub 14:55:15.612 INFO - Starting auto registration thread. Will try to register every 5000 ms. 14:55:15.612 INFO - Registering the node to the hub: http://localhost:4444/grid/register 14:55:15.657 INFO - The node is registered to the hub and ready to use 14:55:25.822 INFO - SessionCleaner initialized with insideBrowserTimeout 0 and clientGoneTimeout 1800000 polling every 180000 验证了网格是否看到了该节点。

集线器看到Firefox 47的请求。

http://localhost:4444/grid/console

节点也是如此,但它会启动14:56:23.028 INFO - Got a request to create a new session: Capabilities [{acceptSslCerts=true, browserName=firefox, javascriptEnabled=true, version=47, platform=ANY}] 14:56:23.029 INFO - Trying to create a new session on test slot {firefox_binary=/Applications/Firefox 47.app/Contents/MacOS/firefox-bin, seleniumProtocol=WebDriver, browserName=firefox, version=47, platform=MAC}

Firefox.app

发生了什么?

1 个答案:

答案 0 :(得分:0)

您可以尝试在DesiredCapabilities中初始化firefox二进制文件;

  DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(CapabilityType.BROWSER_NAME, "firefox");
    capabilities.setCapability("firefox_binary", "{Full path to firefox binary}");
    capabilities.setCapability("marionette", false);
    driver = new RemoteWebDriver(new URL("http://" + host + ":" + port + "/wd/hub"), capabilities);