2017-07-07 97 views
0

我正在嘗試在Linux VM(無頭)上設置Selenium節點。集線器正在端口5786上的Windows設備上運行(4444正在使用)。在Linux上設置Selenium節點

java -jar selenium-server-standalone- 
2.53.0.jar -role node –hub http://<myIP>:5786/grid/register -port 5558 

在i執行此,它返回下列的錯誤消息:

我使用以下代碼發起中樞。

13:42:12.765 INFO - Launching a Selenium Grid node 
13:42:13.435 WARN - error getting the parameters from the hub. The node may 
end up with wrong timeouts.Connect to 10.146.48.80:4444 [/10.146.48.80] 
failed: Connection refused 
13:42:13.445 INFO - Java: Oracle Corporation 24.60-b09 
13:42:13.445 INFO - OS: Linux 3.10.0-514.21.1.el7.x86_64 amd64 
13:42:13.450 INFO - v2.53.0, with Core v2.53.0. Built from revision 35ae25b 
13:42:13.521 INFO - Driver provider 
org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: 
registration capabilities Capabilities [{platform=WINDOWS, 
ensureCleanSession=true, browserName=internet explorer, version=}] does not 
match the current platform LINUX 
13:42:13.521 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver 
registration is skipped: 
registration capabilities Capabilities [{platform=WINDOWS, 
browserName=MicrosoftEdge, version=}] does not match the current platform 
LINUX 
13:42:13.521 INFO - Driver class not found: 
com.opera.core.systems.OperaDriver 
13:42:13.521 INFO - Driver provider com.opera.core.systems.OperaDriver is not 
registered 
13:42:13.522 INFO - Driver provider org.openqa.selenium.safari.SafariDriver 
registration is skipped: 
registration capabilities Capabilities [{platform=MAC, browserName=safari, 
version=}] does not match the current platform LINUX 
13:42:13.523 INFO - Driver class not found: 
org.openqa.selenium.htmlunit.HtmlUnitDriver 
13:42:13.523 INFO - Driver provider 
org.openqa.selenium.htmlunit.HtmlUnitDriver is not registered 
13:42:13.552 INFO - Version Jetty/5.1.x 
13:42:13.553 INFO - Started HttpContext[/selenium-server/driver,/selenium- 
server/driver] 
13:42:13.553 INFO - Started HttpContext[/selenium-server,/selenium-server] 
13:42:13.553 INFO - Started HttpContext[/,/] 
13:44:03.596 INFO - Started 
[email protected] 
13:44:03.596 INFO - Started HttpContext[/wd,/wd] 
13:44:03.599 INFO - Started SocketListener on 0.0.0.0:5555 
13:44:03.599 INFO - Started [email protected] 
13:44:03.599 INFO - Selenium Grid node is up and ready to register to the hub 
13:44:03.630 INFO - Starting auto registration thread. Will try to register 
every 5000 ms. 
13:44:03.630 INFO - Registering the node to the hub: 
http://10.146.48.80:4444/grid/register 
13:44:03.638 INFO - Couldn't register this node: Error sending the 
registration request: Connect to 10.146.48.80:4444 [/10.146.48.80] failed: 
Connection refused 

回答

1

在您共享即命令,

java -jar selenium-server-standalone-2.53.0.jar -role node –hub http://<myIP>:5786/grid/register -port 5558 

您有複製粘貼問題。參數hub之前的-似乎不是hyphen字符。

我能夠推斷出這是一個可能的根本原因,因爲-hub的值完全被忽略,並且4444的默認集線器端口正在嘗試使用。您共享的堆棧跟蹤重新執行此操作

13:42:13.435警告 - 從集線器獲取參數時出錯。節點可以 與錯timeouts.Connect落得10.146.48.80:4444 [/10.146.48.80] 失敗:連接被拒絕

正如你所看到的,即使你提供你的集線器的註冊網址,包括港口號碼5786,仍然撿到4444,抱怨Connection refused

請嘗試輸入啓動集線器的整個命令並重試。這應該工作。