Selenium Grid 2节点无法连接到Hub

时间:2014-05-08 03:24:13

标签: selenium selenium-webdriver selenium-grid

我有一台ip:192.168.1.x的本地机器。 Windows 7的 我有一台带有NAT ip的虚拟机; 10.0.2.15和仅限主机的ip:192.168.70.64 Windows 7

我的集线器设置很简单:java -jar selenium-server-standalone-2.41.0.jar -role hub

我的节点设置如下:

java -jar c:\selenium\selenium-server-standalone-2.41.0.jar -role node -hub http://192.168.1.x:4444/grid/register -browser browserName="internet explorer",version=9,platform=WINDOWS -Dwebdriver.ie.driver=c:\selenium\IEDriverServer.exe -remoteHost http://192.168.70.64:5555

我的集线器上升,但当我启动节点时,我得到了输出:

节点:

jar -role node -hub http://192.168.1.178:4444/grid/register -browser browserName="internet explorer",version=9,platform=WINDOWS -Dwebdriver.ie.driver=c:\selenium\IEDriverServer.exe -remoteHost http://192.168.70.64:5555
May 07, 2014 8:09:08 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a selenium grid node
May 07, 2014 8:09:08 PM org.openqa.grid.common.RegistrationRequest addCapabilityFromString
INFO: Adding browserName=internet explorer,version=9,platform=WINDOWS
Setting system property webdriver.ie.driver to c:\selenium\IEDriverServer.exe
20:09:10.049 INFO - Java: Oracle Corporation 24.55-b03
20:09:10.049 INFO - OS: Windows 7 6.1 x86
20:09:10.063 INFO - v2.41.0, with Core v2.41.0. Built from revision 3192d8a
20:09:10.311 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:5555/wd/hub
20:09:10.311 INFO - Version Jetty/5.1.x
20:09:10.325 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
20:09:10.325 INFO - Started HttpContext[/selenium-server,/selenium-server]
20:09:10.325 INFO - Started HttpContext[/,/]
20:09:10.325 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@152dbbf
20:09:10.325 INFO - Started HttpContext[/wd,/wd]
20:09:10.339 INFO - Started SocketListener on 0.0.0.0:5555
20:09:10.339 INFO - Started org.openqa.jetty.jetty.Server@5c0f8f
20:09:10.339 INFO - using the json request : {"class":"org.openqa.grid.common.RegistrationRequest","capabilities":[{"seleniumProtocol":"WebDriver","platform":"WINDOWS","browserName":"internet explorer","version":"9"}],"configuration":{"port":5555,"register":true,"host":"10.0.2.15","Dwebdriver.ie.driver=c:\\selenium\\IEDriverServer.exe":"","proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy","browser":"browserName=internet explorer,version=9,platform=WINDOWS","maxSession":5,"role":"node","hubHost":"192.168.1.178","registerCycle":5000,"hub":"http://192.168.1.178:4444/grid/register","hubPort":4444,"url":"http://192.168.70.64:5555","remoteHost":"http://192.168.70.64:5555"}}
20:09:10.352 INFO - Starting auto register thread. Will try to register every 5000 ms.
20:09:10.352 INFO - Registering the node to hub :http://192.168.1.178:4444/grid/register

集线器:

$ java -jar selenium-server-standalone-2.41.0.jar -role hub
May 07, 2014 10:08:38 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a selenium grid server
2014-05-07 22:08:39.272:INFO:osjs.Server:jetty-7.x.y-SNAPSHOT
2014-05-07 22:08:39.303:INFO:osjsh.ContextHandler:started o.s.j.s.ServletContextHandler{/,null}
2014-05-07 22:08:39.310:INFO:osjs.AbstractConnector:Started SocketConnector@0.0.0.0:4444
May 07, 2014 10:09:09 PM org.openqa.grid.internal.BaseRemoteProxy <init>
WARNING: Max instance not specified. Using default = 1 instance
May 07, 2014 10:09:35 PM org.openqa.grid.selenium.proxy.DefaultRemoteProxy isAlive
WARNING: Failed to check status of node: Connection timed out: connect

我不知道节点为什么没有连接。谢谢你提前。

3 个答案:

答案 0 :(得分:1)

这与我在家中与工作中设置网络的方式不同。

  

这是主机和VM之间的通信问题,而不是网格特定的。首先解决这个问题,以便您可以双向通信(ping /访问网络共享等);建议是更改VM的网络设置(桥接,内部网络等),禁用防火墙,实时保护等 - Faiz

答案 1 :(得分:0)

当您的主机和节点位于两个不同的域中时,您将遇到此问题。您可以从服务器Ping到节点,反之亦然,但如果您没有设置机器通过n / w相互通信,则会出现此问题。 当我们的网格服务器在域A中并且节点根本不在域中时,我们遇到了这个问题。我们必须将节点拉到相同的域中,以便Grid与节点通信。

答案 2 :(得分:0)

我有两台Windows 7计算机

我已删除节点计算机上的Windows防火墙

这解决了我的问题