Questions tagged [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*.

Selenium Grid is a component of the Selenium project that 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. The tests can be run on any number of machines at the same time.

It provides both environment management and resource allocation as it dispatches your tests against nodes in the grid. The environment management allows you to exert finer-grained control over the environment executed in than Selenium Server provides itself. For example, you can target your tests at specific browser versions or particular platforms.

Selenium Grid consist of HUB and Node. Selenium stand alone server jar executable can work as both Node and Hub. In order to configure Grid there must be a single HUB (selenium server running as HUB), and one or more Nodes (selenium server running as Node) attached to the HUB.

PROS AND CONS

Selenium Grid isn't a silver bullet. It solves a subset of common delegation and distribution problems, but will for example not manage your infrastructure and might not suite your specific needs.

Pros

  1. Scale. Scale by distributing tests on several machines using parallel execution.
  2. Central. Manage multiple environments from a central point, making it easy to run the tests against a large combination of browsers and operating systems.
  3. Minimize. Minimize the maintenance time for the grid by allowing you to implement custom hooks to leverage a virtual infrastructure of registered nodes.
  4. Cross-Platform. If your tests are running on one particular platform, by using a node on another platform you effectively have cross-platform testing.
  5. Smart. Grid can route commands to a certain version of a browser if you have two or more nodes registered, each pointing to a different version of the browser binary.

Cons

  1. Prompted input. You have no capabilities for user input if your tests want to prompt for user input whereas you would if your tests ran locally.
  2. Maintainability. You also need to maintain the health of other computer systems which run your nodes.
  3. Limited power. Certain third party libraries have limitations that prevent them from being used in conjunction with Grid.

References:

  1. Selenium Grid docs on seleniumhq.github.io
  2. Selenium Grid docs on seleniumhq.org
  3. Running Standalone Selenium Server form command line
  4. Selenium to Start Hub Server and register Nodes with Hub
1873 questions
6
votes
1 answer

Selenium Grid + Maven 2

Is there a good tutorial or does anyone have experience with setting this up ? I have a Testsuite.html which launches my tests in one browser atm. This is done in the integration-test lifecycle by the maven selenium plugin. I want to run my tests on…
kukudas
  • 4,834
  • 5
  • 44
  • 65
6
votes
4 answers

How to change port of selenium/hub docker container?

I am executing automation tests using Docker containers. I have to run test suites for multiple applications on the same server. But if I have same port for each selenium hub docker container then I cannot run all these suites at the same time. Thus…
6
votes
1 answer

Jenkins - CI with Virtual Machines

At the moment, I have my framework code written in Java/Maven and I want to run this code using Selenium grid and Jenkins. I've configured Jenkins to pull the latest code from the SVN and have setup Jenkins to act as the hub. What I'm wondering is…
6
votes
2 answers

Running a Selenium Grid 2 with 200 nodes. How can I increase the Jetty threads?

I am currently running a Selenium Grid 2 with more than 50 nodes registered . After some time the hub becomes unresponsive and has a very hard time to serve the back and forth communication (http requests) with the nodes. I read here this : Relly…
Kostas Demiris
  • 3,415
  • 8
  • 47
  • 85
6
votes
1 answer

Chef Selenium: Strange error when I go to the hub ip:4444/wd/hub

I get the following stacktrace: { "status": 13, "value": { "class": "java.lang.NullPointerException", "stackTrace": [ { "fileName": "ExternalSessionKey.java", "className":…
Dennis Hoer
  • 3,039
  • 2
  • 23
  • 34
6
votes
1 answer

Is there any way to delete an HttpOnly cookie from C# Selenium tests?

I have a set of C# Selenium tests that need to delete a cookie that has the HttpOnly flag set. Unfortunately the DefaultSelenium.GetCookie() and DefaultSelenium.DeleteCookie() commands aren't able to access the cookie, because it has that HttpOnly…
BenA
  • 2,041
  • 1
  • 20
  • 25
6
votes
1 answer

Selenium Hub incorrectly believes CLIENT_STOPPED_SESSION has happened

I am running parallel automated tests against a Selenium Grid. Sometimes, a test with fail with; Session [c1d99cc1-c689-4053-b68d-51c3682c13c4] was terminated due to CLIENT_STOPPED_SESSION (org.openqa.grid.common.exception.GridException) [remote…
Robbie Wareham
  • 3,380
  • 1
  • 20
  • 38
6
votes
2 answers

Parameterized Selenium Tests in Parallel with TestNG

First of all, sorry for my english, it's not so perfect :) So I'm facing with the following problem: I'm trying to run parallel tests in different browsers using Selenium Grid and TestNg and I pass the parameters in the @BeforeTest method. My…
peetya
  • 3,578
  • 2
  • 16
  • 30
6
votes
1 answer

subprocess kills child processes but not the processes the child spawns

I have been having an issue whereby I can kill the processes that spawns the nodes but the nodes do not get killed. Does anyone have any suggest how I can do this? Some of my latest failed attempts to accomplish this…
Calum
  • 2,110
  • 2
  • 22
  • 39
6
votes
2 answers

Selenium Grid with Ant sequential + parallel execution

I am trying to run the selenium tests with selenium grid 2 set up. My tests are more dependent . I have to well-define my sequential run & parallel run. Attaching my build.xml file for ref. Inside sequential node I have many parallel nodes with…
Anjana
  • 79
  • 1
  • 1
  • 5
5
votes
2 answers

Selenium is not able to launch the IE.

Selenium is not able to launch the IE. 10:56:25,005 INFO [org.openqa.selenium.server.SeleniumDriverResourceHandler] Command request: getNewBrowserSession[*iexploreproxy, http://192.168.132.105:8080/, ] on session null 10:56:25,005 INFO …
5
votes
1 answer

Using Selenium 2 RemoteWebDriver with ChromeDriver

I searched for an answer to my question here and on the web but couldn't find anything that was helpful to me. Hopefully this isn't too dumb of a question. I'm trying to get Selenium 2 to work using various browsers. I am using a Mac as a hub and a…
Ryan Frost
  • 81
  • 1
  • 5
5
votes
1 answer

How to get a list of available browsers from selenium hub?

Is there anyway to get a list of available browsers that are registered with the selenium hub using java? For example I can use my browser to go to the console (ie. www.foobar.com:4444/grid/console) and that gives me a list of all sessions, but is…
5
votes
2 answers

How to upload a file by transfering the file from the local machine to the remote web server using Selenium Grid

File Upload with a Selenium Grid: Code import java.net.MalformedURLException; import java.net.URL; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import…
5
votes
1 answer

Running Docker in Windows Virtual Machine

Using: Docker Desktop for Windows 10 MobaXterm to RDP into a Windows 10 VM Selenium 3.141.59 I'm currently trying to run a selenium Grid within a docker container and I'm encountering some issues. I have both Hyper-V and Containers enabled on both…