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
4
votes
1 answer

Selenium Grid 2 - API version of /console page

I am writing a status monitoring page for our test environment and would like a list of individual selenium/webdriver nodes which are registered with the Grid server. I can do this by scraping the information on /console but I was wondering if…
Mark Micallef
  • 1,051
  • 2
  • 12
  • 25
4
votes
1 answer

Add more instances to Selenium Docker

I have downloaded Selenium Grid from a Docker compose, following the documentation. Now, I have all the images up and running. Also, the UI is working. For each browser, I have only one instance. I want to increment the number of instances for…
Enrico
  • 3,592
  • 6
  • 45
  • 102
4
votes
2 answers

Error: no DISPLAY environment variable specified

I have set up one Selenium Grid with one Hub in Ubuntu Server and one Node in Ubuntu Desktop. Installed Geckodriver and Firefox on the Node machine. And using the following python code. from selenium import webdriver from…
4
votes
0 answers

new session request for webdriver should contain a location header or an 'application/json;charset=UTF-8' response body with the session ID

I am trying to run a Selenium Java testing using grid. My hub is in an aws windows instance and node is my local computer. I am able to connect my local system to aws instance VM using port forwarding on a wifi connection. But on running Java…
4
votes
0 answers

ChromeDriver ERR_SSL_PROTOCOL_ERROR despite --allow-insecure-localhost

I have Selenium tests where I'm using ChromeDriver to go to https://localhost:. The port number in this case is using a self-signed certificate to support HTTPS connection. However, when ChromeDriver opens and tries to navigate to that…
4
votes
1 answer

System.InvalidOperationException : Unable to create new service: ChromeDriverService with ChromeDriver and SeleniumGrid on local machine

I had set up Selenium Grid (Both Hub and Node) on my local machine which runs on Windows 10 using below command for registering Hub. java -jar selenium-server-standalone-3.141.59.jar -role hub and for registering a Node, I had used below…
4
votes
1 answer

UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server with Selenium Grid

Error in opening new driver window: org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. server log: Forwarding newSession on…
4
votes
2 answers

PlatformNotSupportedException: The following constructor parameters did not have matching fixture data

I wrote some tests with dotnet core 2. This tests drive some Selenium's browsers. I developed the first test in local (using dotnet core 2.0 and xunit) and it workes like a charm. Then I moved the project into Azure DevOps pipeline and I get this…
BAD_SEED
  • 4,840
  • 11
  • 53
  • 110
4
votes
1 answer

How to deploy Selenium Grid in Azure DevTestLabs

I'm trying to execute remote selenium tests via Azure. To do this, I used https://github.com/Azure/azure-devtestlab/tree/master/samples/DevTestLabs/QuickStartTemplates/201-dtl-create-lab-with-seleniumgrid I create a custom template with the selenium…
Nancy Cruz
  • 115
  • 1
  • 10
4
votes
1 answer

Run yaml file for parallel selenium test from R or python

I have a simple yaml file: seleniumhub: image: selenium/hub ports: - 4444:4444 firefoxnode: image: selenium/node-firefox-debug ports: - 4577 links: - seleniumhub:hub chromenode: image:…
Mislav
  • 1,533
  • 16
  • 37
4
votes
1 answer

Chrome & Firefox on Windows vs Linux (selenium)

I'm running Selenium grid with only Windows machines and the resource use is quite high. I've been toying with the idea of putting Chrome and Firefox inside docker containers to improve efficiency. My question is are there any key differences in the…
LiamHarries
  • 570
  • 1
  • 5
  • 20
4
votes
1 answer

Setting up Selenium Grid using Script

Setting up selenium Grid: I was able to set up grid (hub & node) using below commands in command prompt and then able to launch browsers and execute test successfully. java -jar selenium-server-standalone-3.4.0.jar -role hub java -jar…
4
votes
1 answer

Video does not start with geckodriver

I'm working with automated tests and I'm trying to set up selenium grid for running tests in multiple environments. I've successfully ran tests with chrome driver in Mac OS X 10.11 and Windows10. Right now when I try to run a test feature, in a…
jlnabais
  • 829
  • 1
  • 6
  • 18
4
votes
1 answer

How do I get my Selenium Grid Hub log

I have a selenium grid2 set up on an AWS instance, and I was wondering if there's a way I could view the logs on my local machine? I understand I can visit: http://MyServerAddress/grid/console and view all of the nodes but I want the actual log. Its…
4
votes
1 answer

Using FireFoxProfile with RemoteWebDriver, Selenium Grid2, causes Capabilities Exception

I am trying to programmatically create a temporary firefox profile for use in selenium tests with selenium grid2. Here is the code that I am currently running. DesiredCapabilities capabilities = new…