Reputation: 121
I launched a hub on the physical machine (Windows 10, RAM 16Gb, x64):
java -jar selenium-server-standalone-2.53.0.jar -role hub port 4444
Also I registered a node on the virtual machine (I use VirtualBox: Linux, Ubuntu 16.04.2; i386. Base memory: 2048 Mb):
java -jar selenium-server-standalone-2.53.0.jar -role webdriver port 9999 -hub http://172.xx.xxx.248:4444/grid/register
Node is visible from grid console, but connection is failed Cannot run tests.
Configurations in IDE: WebDriver driver = new RemoteWebDriver(new URL("http://10.0.2.15:9999/wd/hub"), capabilities);
Error while running the tests:
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to 10.0.2.15:9999 [/10.0.2.15] failed: Connection timed out: connect
Physical machine address: 172.xx.xxx.248
Virtual machine address: 10.0.2.15
Upvotes: 3
Views: 3327
Reputation: 121
I found a solution. VM (VirtualBox in my case) should be configured the following way:
Go to Settings -> Network
1. Attached to should be 'Bridged Adapter'
2. Expand 'Advanced' -> Promiscuous mode should be 'Allow All'
Upvotes: 5
Reputation: 945
You are starting your RemoteWebDriver with wrong URL, you should give it hub IP to register on, not node IP.
WebDriver driver = new RemoteWebDriver(new URL("http://172.xx.xxx.248:4444/wd/hub"), capabilities);
This should solve your issue.
Upvotes: 0