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
3 answers

Parallelizing Cucumber BDD test on multiple machines using Gems or Jenkins (or both)

I’m running a project using BDD with Cucumber (with page_object gem), Watir and Jenkins. Right now we’re looking the best way to parallelize test to reduce testing time on multiple virtual machines, with different navigators and so on. I think there…
Pablo Gómez
  • 621
  • 1
  • 8
  • 18
3
votes
1 answer

WebDriver Grid with HtmlUnit on Node pegs the Node CPU

I am usign C#, with Gallio/mbUnit to write a very simple set of tests that open a browser, navigate to google.com, type 'seleniumhq' in the search box, and click the search button. I create my host with: java -jar…
Jesse Sanders
  • 511
  • 6
  • 13
3
votes
1 answer

Grid Hub http client timeout if waiting for a slot to be free

Is there a way to query my grid hub (2.6.0) to see if there are slots free for a particular desired capability? Example: Grid Hub web page at http://localhost:4444/grid/console Shows properly that 1 request should wait for a slot to be free so…
Leo Gallucci
  • 16,355
  • 12
  • 77
  • 110
3
votes
1 answer

Node is not able to connect to Hub, keep sending registration event

Objective: UI test execution takes quite a time and we have a lot of UI test cases, currently we have a grid setup on AWS EC2 but scaling and descaling of resources manualy is time-consuming, so we decided to explore AWS ECS Fargate where we can…
3
votes
1 answer

selenium-4 - Not able to handle HasAuthentication popup with Remote driver

I was trying to handle authetication popup and is working fine in local (when we create webdriver instance with chromeDriver). But if we try with RemoteWebDriver, we are getting below mentioned exception. Our problem is to handle authentication pop…
3
votes
0 answers

How to change the websocket port for the Selenium VNC?

I'm running the Selenium on Kubernetes, behind the Ingress-Nginx controller. One thing I noticed is when I try to see the live VNC through the Selenium Grid web, the browser keeps trying to connect the 4444 port of the Selenium grid server for the…
kycfeel
  • 349
  • 1
  • 3
  • 10
3
votes
2 answers

Integrate Selenium Grid and Sikuli API

Currently, I am working on the automation testing framework, which combines with both Selenium Grid and Sikuli API. I already implemented a library which includes functionality of Selenium and Sikuli, and it works well when I set up my hub and node…
user836112
  • 353
  • 3
  • 7
  • 14
3
votes
2 answers

Chrome Node is not registering to Selenium Hub after upgrading to Selenium Grid 4.0.0

We are using a docker-compose file for creating a selenium grid network and after upgrading to selenium grid version 4.0.0 we have found that the grid is not registering to the node. In this case, we are always receiving the below error. chrome_1 …
3
votes
3 answers

selenium grid parallel execution

this is from selenium grid. How to write java/C# code to make parallel execution. Is this enough? ISelenium selenium1 = new DefaultSelenium("localhost", 5555, "*iehta", "http://localhost/"); ISelenium selenium2 = new DefaultSelenium("localhost",…
senzacionale
  • 20,448
  • 67
  • 204
  • 316
3
votes
3 answers

How to install Selenium Grid 4 in Kubernetes?

I want to install Selenium Grid 4 in Kubernetes. I am new to this. Could anyone share helm charts or manifests or installation steps or anything. I could not find anything. Thanks.
Aman
  • 193
  • 2
  • 15
3
votes
2 answers

Docker Compose - Starting already created containers

I am new to Docker and I am trying to run Selenium Grid tests on Docker. For this purpose, I created a docker compose file and executed below command docker-compose -f docker-compose.yaml up Everything worked fine but after a few hours I restarted…
Miracle
  • 81
  • 6
3
votes
1 answer

What is the exact purpose of Selenium Grid?

I am new to Selenium, TestNG and Selenium Grid. I got slightly confused about when exactly I need to use Selenium Grid. Below are my understandings on this. Just let me know if i am right : Selenium Grid is only for running your tests remotely on…
anandhu
  • 686
  • 2
  • 13
  • 40
3
votes
2 answers

Tests fail immediately with unknown error: DevToolsActivePort file doesn't exist when running Selenium grid through systemd

I've been trying to change the way I start the Selenium grid service from a shell script in .rclocal to a systemd service, but it is not working. The script is this: #!/bin/bash java -jar /opt/selenium-server-standalone.jar -role hub -hubConfig…
elgato
  • 506
  • 1
  • 5
  • 20
3
votes
0 answers

Enable downloads in headless chrome with Selenium Grid

The only way that I've found to enable downloads in Headless Chrome is with the following code: var param = new Dictionary(); param.Add("behavior", "allow"); param.Add("downloadPath",…
Jack
  • 241
  • 2
  • 14
3
votes
1 answer

Selenium WebDriverException: Session [null] not available and is not among the last 1000 terminated sessions

I am getting the below WebDriver exception when trying to navigate to a URL (just simply to Google) using Selenium Grid running locally. org.openqa.selenium.WebDriverException: Session [null] not available and is not among the last 1000…
John S
  • 31
  • 1
  • 2