Grid hub and node - Unable to register the node in different machine - selenium-grid

I am trying to install Selenium Grid - hub in one machine(windows 10) and node(windows 8.1 physical device) in different machine. I am able to successfully register the hub, but stuck in node registering. I used java -jar C:\selenium-server-standalone-3.0.0.jar -role node -hub http://192.168.56.1:4444/grid/register -port 5555. Getting error: couldnt register the node: the hub is down or not responding. I tried webdriver instead of node, still no luck. Any help will be much appreciated. Thanks

Related

Unable to connect Selenium 3.12.0 Grid Node to the Grid Hub

I have my hub running on my Windows 10 machine, which is also the VirtualBox host. I am running an OS X High Sierra VirtualBox as the node.
When I try to register the node with this command:
java -Dwebdriver.firefox.driver=/Users/jlott/Desktop/geckodriver -jar /etc/selenium-server-standalone-3.12.0.jar -role node -hub http://10.195.0.159:4444/grid/register
I get the following error:
node error
Thank you in advance for any help.
While working with Selenium Client 3.x, GeckoDriver 0.20.1 and Firefox Quantum v60.0.2 to start the Selenium Grid Node you need to use the following commans:
java -Dwebdriver.gecko.driver=<absolute_path>/geckodriver -jar /etc/selenium-server-standalone-3.12.0.jar -role node -hub http://10.195.0.159:4444/grid/register
Ok, I figured out what was preventing the connection. I needed to add a firewall exception for the tcp port I am using in the Windows Firewall settings. Once I added this, the node connected successfully.

Node is not accessible from hub in selenium grid

I just started the hub on my local machine using the following command.
java -jar selenium-server-standalone-3.12.0.jar -role hub
it started successfully, then I have tried to connect a node to another machine using the following command.
java -Dwebdriver.chrome.driver=d:\sel\new\chromedriver.exe -jar selenium-server-standalone-3.12.0.jar -role node -port 5566 -hub http://"HUbip":4444/grid/register
it has shown me The node is registered to the hub and ready to use in the console.
but when I opened Http://"HUbip":4444/grid/console it has shown the IP and 5 chrome browser, 5 Firefox, 1 internet explorer logos. But at the top of that, the text has shown like "DefaultRemoteProxy unknown version, Failed to connect to Ip of the node".
so when I have tried to run the test I am getting an error like "Could not start a new session. Possible causes are the invalid address of the remote server or browser start-up failure.
Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:03.216Z'".
I have already switched off both machine's firewall. and tried to telnet from the node to hub, it was a success.
I am unable to rectify the issue. someone, please suggest a solution.
Add in Selenium Grid Extras which can help you with the management of Selenium Grid like :
Restart the node/hub
Clear session
Recommends the defaults for the ports
You'll need to run the setup on the hub and node:
java -jar SeleniumGridExtras-*.*.*-SNAPSHOT-jar-with-dependencies.jar
Note: You're not using the standard port for the node 5555.

Selenium Grid Node is repeatedly registering with the hub (Selenium 3.3)

I run this command on a virtual machine to register a node with my Selenium Grid hub:
java -Dwebdriver.ie.driver=C:\IEDriverServer.exe -Dwebdriver.chrome.driver=C:\chromedriver.exe -Dwebdriver.gecko.driver=C:\geckodriver0-15-0.exe -jar selenium-server-standalone-3.3.0.jar -role node -port 5555 -hub http://10.201.1.201:4444/grid/register -browser "browserName=internet explorer, version=10, platform=WINDOWS, maxInstances=5" -browser "browserName=chrome,maxInstances=5,platform=WINDOWS" -browser "browserName=firefox,maxInstances=5,platform=WINDOWS"
As a result, the node seems to connect correctly, but every minute or so I see
"Registering the node to the hub: [hub ip]
The node is registered to the hub and ready to use."
This doesn't seem to cause any errors with my tests, but I'm curious why it is repeatedly trying to register. I believe this started when I upgraded Selenium Server Standalone to 3.3.
I'm also noting that from my hub, I see that it keeps "marking the node as down because it can't be reached for 2 tries". Then it immediately registers that node again, and then it's down again, repeated forever.
There is a bug that should be fixed in version 3.3.1. It seemed to produce the same problem you're seeing. If it still doesn't work I'd recommend commenting on the github issues.

How to run selenium server sessions on different xvfb screens?

My problem is how to get an isolated video streams from SeleniumServer browser instances. Let me explain.
I have Selenium Server hub running at Ubuntu Server machine and the Selenium Server node running at the same server so I use the 'headless' Selenium mode using xvfb. I run the nodes like this: DISPLAY=:99 java -jar selenium-server-standalone.jar -role node -hub http://localhost:4444/grid/register
Then I wanna get video streams of the tests running there so I installed the x11server connected to the xvfb virtual display and after that I can to connect those remote server using VNC and I see my tests processing. The trouble is that all browser instances inside the node rendered at the same virtual display (#99) and when I need running several tests at the same time, I see many browser instances overlaying one by one. But I wanna record the error tests video streams so I can't do this. So I need to have probability to connect to every browser virtual display apart.
I think I can solve this problem by tuning the xvfb server somehow to force it to create isolated virtual display or screen (xvfb has multiscreen support, hasn't it?) for every client (browser instance in my case). But I have tried to do this and I have not get a result. Also I can use another virtual display (not xvfb) if it's necessary to solve this.
Please, help me to get isolated video streams from every browser instance :) Thanks a lot and sorry about my English.
With the selenium hub, you can add the browsers in separately in their own Xvfb sessions
java -jar selenium-server-standalone-2.33.0.jar -role hub&
then connect each browser separately in its own Xvfb session, DISPLAY and port
export DISPLAY=:11
Xvfb :11 -screen 0 1024x768x16 &
java -jar selenium-server-standalone-2.33.0.jar \
-role node \
-port 4441
-hub http://localhost:4444/grid/register \
-browser "browserName=firefox,version=19,maxInstances=5"&
For this kind of use, you could typically use the xvfb-run command (which can select automatically a display, but it can be configured)
Then you can create a firefox start script that would do xvfb-run firefox that you could use as the selenium firefox start command (specified as a FirefoxBinary)

Selenium WebDriver and Grid 2

I try to run Grid2, but I don't understant basic thing.
I have the Hub, and I run on the hub machine the next command:
java -jar selenium-server-standalone-2.14.0.jar -role hub
I have a node, and I run on it the next command:
java -jar selenium-server-standalone-2.14.0.jar -role node -hub http://localhost:4444/grid/register
Now, I want to run a test in Java that would execute only on the node (and not on the hub). But the code of the test is on the Hub machine. How can I make it happen?
If you're running the hub and node on the same machine then yes, when you run your tests they will start on the node where your hub is located. In order to get around this you're going to need at least 2 machines, 1 to run your hub and 1 to run your node.
Start your hub on machine A then have your node register to the hub, when you start your tests on the hub machine it will automatically select an available node and run the tests.
It doesn't matter where your code lies. Your code communicates with the hub and tells it which node to execute the case on based on the desiredcapabilities object.
In your case as well, the case is running on the node only. Hub just does the task of distributing it to appropriate node. Its just that the node is on the same machine as the hub, so you do not see a difference.