2016-12-14 63 views
0

我想在OS X上使用Selenium Grid 3.0.1與Firefox 47. /Applications/Firefox.app是Firefox 50. /Applications/Firefox 47.app是Firefox 47.無論我嘗試什麼,Selenium都會推出/Applications/Firefox.appSelenium Grid推出錯誤版本的Firefox

我已經在集線器模式下運行獨立服務器。

$ 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 [email protected]{/,null,AVAILABLE} 
2016-12-14 14:54:04.141:INFO:osjs.ServerConnector:main: Started [email protected]{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 

然後設置使用Firefox 47

$ 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 [email protected]{/,null,AVAILABLE} 
2016-12-14 14:55:15.587:INFO:osjs.ServerConnector:main: Started [email protected]{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 

我通過http://localhost:4444/grid/console驗證了網格看到該節點的節點。

集線器看到的要求Firefox的47

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代替。

14:56:23.041 INFO - Executing: [new session: Capabilities [{acceptSslCerts=true, browserName=firefox, javascriptEnabled=true, version=47, platform=ANY}]]) 
14:56:23.049 INFO - Creating a new session for Capabilities [{acceptSslCerts=true, browserName=firefox, javascriptEnabled=true, version=47, platform=ANY}] 
1481756183115 geckodriver INFO Listening on 127.0.0.1:19913 
14:56:23.141 INFO - Attempting bi-dialect session, assuming Postel's Law holds true on the remote end 
1481756183145 mozprofile::profile INFO Using profile path /var/folders/0b/7xp2lxbd7yl0tcpms06fr3d40000gn/T/rust_mozprofile.zhTJMwOyP59u 
1481756183151 geckodriver::marionette INFO Starting browser /Applications/Firefox.app/Contents/MacOS/firefox-bin 

發生了什麼事?

回答

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); 
+0

這看起來像Java?我使用的是Perl客戶端,但具有與從集線器和節點日誌中的功能行中可以看到的相同的功能...除了將'marionette'設置爲'false'外。這是做什麼的? – Schwern

+1

而不是在節點的命令行中指定firefox瀏覽器的路徑,請嘗試在運行時調用瀏覽器時提供路徑。 marionette = False用於Firefox 47。 –