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

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)

Related

What is a hub in the Selenium grid?

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.

Selenium java - can we run selenium multiple instances at same time on server

Details -
Can we run the multiple instances of selenium script at same time
while running multiple instances of selenium script at same time my script failed connection refused
AnyOne has the solution for it .
You can try something called Selenium Grid.
Selenium-Grid allows you run your tests on different machines against
different browsers in parallel. That is, running multiple tests at the
same time against different machines running different browsers and
operating systems. Essentially, Selenium-Grid support distributed test
execution. It allows for running your tests in a distributed test
execution environment.
You can find more on the following website= https://www.seleniumhq.org/docs/07_selenium_grid.jsp.
Also, check out this response as well. It was for a similar question= Running multiple Selenium tests at the same time

How can we run the selenium tests on different machines without giving the manual configurations to the nodes

I would like to run the test on different machines. But I don't want to set the manual configurations to the nodes and I want the hub to take control on the nodes.
Please help me on this

Any idea for executing Selenium webdriver + Java/Python tests from Cloud

I can't found any question/answer about that (probably I don't know how to find it...)
Could somebody give me a global idea to execute +200 Selenium webdriver tests (Python) from cloud servers/tools?
Thanks!!
rgzl
Another way is Saucelabs, using this service you'll be able to just send your Selenium
Java/Python tests
to their Cloud infrastructure for execution. The benefits of such testing are obvious – no need to waste time and resources setting up and maintaining your own VM farm, and additionally you can run your test suite in various browsers in parallel. Also no need to share any sensitive data, source code and databases.
As said in this acticle:
Of course inserting this roundtrip across the Internet is not without cost. The penalty of running Selenium tests this way is that they run quite slowly, typically about 3 times slower in my experience. This means that this is not something that individual developers are going to do from their workstations.
To ease the integration of this service into your projects, maybe you'll have to write a some kind of saucelabs-adapter, that will do the necessary SSH tunnel setup/teardown and Selenium configuration, automatically as part of a test.
And for a better visualization:
Here's a global idea:
Use Amazon Web Services.
Using AWS, you can have a setup like this:
1 Selenium Grid. IP: X.X.X.X
100 Selenium nodes connecting to X.X.X.X:4444/wd/register
Each Selenium node has a node config, running 2 maxSessions at once. (depending on size of course)
Have also, a Continuous integration server like Jenkins, run your Python tests Against X.X.X.X grid.

How to maintain Selenium Grid?

I have many VMs which are used as part of Grid. Some as RC and some as Hub. Due to the large number of VMs that is being used, it is a big task to maintain the grid now. To change the RC to point to a different hub, I will have to
login to that machine
kill the current RC
run the java command again with a different hub URL
Yes, I can use a batch script to restart all the machines. But what if I just want to change just one machine?
Is it possible to create an application using JAVA RMI which can run the required commands to kill, start, restart the RCs or Hub? Has anyone ever tried to create such an application?
you should have a look at selenium grid2.0. It's been designed with exactly what you ask in mind.
You can create your own proxy extending either the selenium1 ( RC ) or selenium2 ( webdriver protocol ), and implement a list of interfaces that will allow to react to certain events.
You could for instance :
have one unique hub controlling all the nodes and refine the routing by implementing the matcher.
update the grid console to have some "reconfigure node" functionality directly there
add some rules on each node, for instance restart the VM and the server within it automatically every X test or when a specific event is detected.
I wouldn't start a RMI based solution. If you have VMs, you should have access to the VM API for the solution you choose, and you can use that to revert to a known clean state and restart from there each time. That will ensure you don't have left over crashed browsers and things like that.
thanks,
François
i know this is old question. How about setting puppet on your VM so you just need to specify one config on master.