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
13
votes
2 answers

Selenium 2 Grid - Knowing which node your test is using

Is it possible to know which node the selenium grid hub assigned to your test? My tests need to talk to other services on the node machine in order to perform configurations which are not supported by selenium. Mark
Mark Micallef
  • 1,051
  • 2
  • 12
  • 25
13
votes
5 answers

selenium.common.exceptions.InvalidCookieDomainException: Message: invalid cookie domain while executing tests in Django with Selenium

I am setting up tests for both chrome and firefox using seleniumgrid.I am using docker images selenium-hub and selenium node-chrome and node-firefox as below. app: build: . command: gunicorn --reload --capture-output --log-level debug…
StackEdd
  • 624
  • 1
  • 10
  • 23
13
votes
2 answers

How to increase Selenium grid session timeout?

While running my test, I need to have long delays (~40 seconds). And I see, that Selenium session gets deleted during that time. Please help: How can I configure session timeout to increase? Here what I see in less, that 30 secs, after delay started…
Slavik
  • 1,488
  • 1
  • 15
  • 24
12
votes
5 answers

ChromeDriver ERR_SSL_PROTOCOL_ERROR despite --ignore-certificate-errors

I'm trying to run integration tests on a local host (with no HTTPS) using selenium with ChromeDriver. Chrome requires an https certificate, but from this question i understand that i can circumvent this using the arg --ignore-certificate-errors I…
Preston
  • 7,399
  • 8
  • 54
  • 84
11
votes
3 answers

RemoteWebDriver Chrome - start maximized

I need chrome to start maximized when running via the selenium grid. This is how do I initialize it now: Selenium selenium = new DefaultSelenium("localhost", 4444, "*googlechrome", "http://www.google.com"); DesiredCapabilities capabilities =…
Pavel Janicek
  • 14,128
  • 14
  • 53
  • 77
11
votes
2 answers

Selenium hangs when launching Firefox on Ubuntu

My end goal is to have Selenium running 'within' Jenkins. My Jenkins installation runs within an Ubuntu virtual machine. After some issues with the jenkins selenium setup (stemming from permissions for the user that jenkins runs under) I switched to…
mattbilson
  • 558
  • 2
  • 5
  • 15
11
votes
3 answers

Selenium RemoteWebDriver c# - System.InvalidOperationException

I have a sample UI test project using v3.4.0 of Selenium.WebDriver. Everything works fine when I run the tests against a local driver but I want to get things working using Selenium Grid 2. As soon as I try to instantiate a new RemoteWebDriver I get…
obaylis
  • 2,904
  • 4
  • 39
  • 66
11
votes
12 answers

how to close selenium hub/grid from command prompt

I start Selenium hub to start Selenium Grid from command prompt on port 4444. Now I start Selenium RC from other command prompt. It shows me error message that "Selenium is already running on port 4444. Or some other service is..." Now I am not able…
tejas trivedi
  • 111
  • 1
  • 1
  • 3
11
votes
6 answers

Cannot open Selenium Jar file from CMD. Path or ClassPath issue?

I'm trying to launch: java -jar selenium-server-standalone-2.14.0.jar -role hub from my Command Prompt but output was as below: C:\Program Files (x86)>java -jar selenium-server-standalone-2.14.0.jar -role hub Unable to access jarfile…
lbrown
  • 615
  • 3
  • 10
  • 19
10
votes
7 answers

Error registering PhantomJS node in Selenium Grid

I have the following problem I successfully launched Selenium Grid hub with: java -jar selenium-server-standalone-2.53.0.jar -role hub After that I tried to launch PhantomJS node with: phantomjs --webdriver=8090…
10
votes
2 answers

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'…
skavans
  • 374
  • 3
  • 18
9
votes
8 answers

How to autoupdate chromeDriver & geckDriver in selenium

I have selenium grid setup with multiple node machines , where in I am manually downloading chromeDriver & geckoDriver on all selenium node machines & using them for chrome & firefox browsers respectively. Now here chrome & firefox browsers (on all…
sjethvani
  • 498
  • 1
  • 7
  • 17
9
votes
1 answer

IE11 test runs if specified direct node ip but fails when grid hub url specified

I use nodejs selenium-standalone and I have: 1) selenium-standalone running on Mac with role=hub 2) selenium-standalone running on Mac with role=node (to run tests on local Mac browsers) 3) Windows 10 installed on parallels desktop with…
Vadim
  • 538
  • 2
  • 5
  • 23
9
votes
3 answers

How to terminate session in Selenium Grid(Extras)

How to terminate session in Selenium Grid? My problem is that if my test fail hub still keep session for this test and I can't run another test (it run but fail because can't get free node, because it is registered in hub). I have found this How to…
slovvic
  • 417
  • 3
  • 6
  • 14
9
votes
2 answers

Selenium Grid error on GitLab CI: Error forwarding the new session Empty pool of VM for setup Capabilities

Since documentation on GitLab CI configuration and Selenium is generally poor, I'm asking for help. Configuration as by interest point: gitlab.ci.yml: image: node:7 variables: HUB_PORT_4444_TCP_ADDR: "selenium__hub" HUB_PORT_4444_TCP_PORT:…
Ain Tohvri
  • 2,987
  • 6
  • 32
  • 51