What is a hub in the Selenium grid? - selenium

As per the documentation:
Hub is the central point in the Selenium Grid that routes the JSON test commands to the nodes. It receives test requests from the client and routes them to the required nodes.
What is a hub in the Selenium grid?

Selenium Grid
Selenium Grid allows the execution of WebDriver scripts on remote machines (virtual or real) by routing commands sent by the client to remote browser instances. It aims to provide an easy way to run tests in parallel on multiple machines.
In simple words, Selenium Grid allows us to run tests in parallel on multiple machines, and to manage different browser versions and browser configurations centrally (instead of in each individual test).
Selenium Grid Hub
The Selenium Grid Hub is the central point where all your tests are sent. Each Selenium Grid consists of exactly one hub. The hub needs to be reachable from the respective clients (i.e. CI server, Developer machine etc.) The hub will connect one or more nodes that tests will be delegated to.

Related

Does selenium grid runs only Selenium command or also code chunk from different library

I have done my automation in Robotframework and I am using many libraries like Selenium2Library, Sikuli Library, HTTP Library, OS library and few more.
When I am running test on Selenium Grid, it invokes the browser on node and runs those steps which are from Selenium.
However, it does not run commands from Sikuli Library. Is selenium grid capable of running keywords from different libraries?
No, the selenium grid only works with selenium. The selenium grid is a server much like a web server. It listens for specific commands, and performs those commands. It will only respond to commands from selenium clients.
When using Sikuly in Robot Framework it is necessary to first setup the external sikuly server and then connect to it from Robot Framework. Typically this is a localhost connection, but connecting to an external host is also possible.
When using Selenium Grid, a connection is made to an anonymous node and thus the host to which the Sikuly server is runnning as well. Did a quick check in google and found that getting the hostname/IP of the running node from the hub is possible. Using the code example here I think it should be possible to create a direct connection to the Sikuly server.

Selenium Grid - Is there a limit to how many simultaneous incoming test connections can be made to a hub?

I have a selenium grid set up with several nodes covering different operating systems and browsers which I use for cross-browser compatibility testing for a site. Those tests are automatically triggered as part of the Jenkins-controlled CI, and currently that grid is for the sole use of that site's testing.
However, does anyone know if there is a limit to the number of incoming test connections for a grid? I want to know if I can reuse this grid for testing another site, so a separate set of tests being triggered by different Jenkins jobs. Will that cause conflicts if the original set of tests happen to be running at the same time, or will the hub simply redirect the new stream of tests to a suitable, free node, and the two sets of tests would run happily in parallel?
If that is the case (parallel running) is there a known limit to how many different sets of tests would be able to use that same hub (assuming enough nodes were connected to service the requests coming in)?
or will the hub simply redirect the new stream of tests to a suitable, free node, and the two sets of tests would run happily in parallel?
This.
The hub can run as many tests in parallel as there are nodes connected. If a node has more than one browser available, you can use them all, given the -maxSession option is set correctly.
This is also interesting:
-browser < params > If -browser is not set, a node will start with 5 firefox, 1 chrome, and 1 internet explorer instance (assuming it’s on a windows box)

Jenkins, running selenium tests on local dev machine

I have a Jenkins server running in private cloud and the dev team want to be able to run some selenium tests on their local dev rigs.
I've looked at Selenium Grid and installed the Selenium Grid plugin for Jenkins and whilst I can get nodes to register to the Jenkins server (Selenium Hub) I cannot invoke tests on the node.
The local dev machines are on our corporate network behind a firewall with no option for that to be changed.
Does the Selenium Hub try to make a new connection to the node when it needs to, or does it/can it use the connection initiated by the node as some kind of reverse tunnel?

How to invoke test in remote machine using selenium JS Grid

I am new to Selenium and I am trying to execute test in remote machine using Selenium Grid and Javascript (in Node Js) I am now able to connect to remote machine from js.
In Java, we use RemoteWebDriver and give Node machine URL. there are plenty of examples in Google
how will we do the same from Javascript. can any one please provide me step by step procedure to Invoke Sample tests in Node Machine from Hub Machine.
Many thanks
Vijay Bhargav

How does the Selenium Grid2 load balancing method works?

I'm using Selenium Grid2 for executing Selenium Scripts remotely.
Is anyone aware if the Grid2 Hub actually load-balance the workload?
For instance... I have a Grid Hub with 2 registered Nodes, both registered with the same capacities (5 firefox, 5 chrome). What I'm seeing is that all tests are being directed to the first registered node, even if the second node has no work at all.
Does this means that only after a node is at it's full capacity, then the Hub will redirect the job to the second node, and so on?
Thanks and Regards,
Rodrigo.