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

Selenium hub with internet explorer node

Is possible to use selenium hub with internet explorer node? I can use Selenium hub with Firefox and Chrome node using docker and kubernetes with the images on https://hub.docker.com/u/selenium. But in Selenium's docker hub don't has internet…
5
votes
3 answers

org.openqa.selenium.json.JsonException: Expected to read a START_MAP but instead have: END. Last 0 characters read while executing tests through Node

I am new to Selenium and started learning it. But the Selenium Grid is not working for me. The server version used is selenium-server-standalone-3.14.0.jar. Using command, the hub and node are running. The code for adding nodes to hub is written…
muzirisrd -
  • 61
  • 1
  • 1
  • 8
5
votes
1 answer

What is the correct docker-compose yml to set maxSessions & maxInstances for selenium hub node-chrome

As a newbie to docker-selenium, yml and docker compose, can someone please advise me how to correctly set the max hub sessions and node essions/instances in docker compose? I'm currently using this yml:- version: '2' services: chrome: image:…
Dave00Galloway
  • 609
  • 1
  • 6
  • 20
5
votes
4 answers

How to connect to docker container from localhost

I created a docker container which is running 2 java processes - one of the processes is listening on port 4444 and should have access from browser hitting the following URL: http://{host}:4444/grid/console How do I hit this URL from my browser on…
Adi Ohana
  • 927
  • 2
  • 13
  • 18
5
votes
1 answer

enablePassThrough not available for selenium server 3.9.1

I was using selenium server 3.7.1 for my test setup using this command: java -jar selenium-server-standalone-3.7.1.jar -enablePassThrough false But trying to update to 3.9.1, I get an error: Exception in thread "main"…
Olle Härstedt
  • 3,799
  • 1
  • 24
  • 57
5
votes
2 answers

SessionNotCreatedException: Unable to create new service: GeckoDriverService with Selenium Grid on Ubuntu failing to drive Firefox

I fail to drive Firefox from Selenium with geckodriver. This is odd, because chrome is driven with same framework without errors! These are my Version numbers: Firefox 54.0 (64-bit) Chrome Version 62.0.3202.94 (Official Build)…
Leder
  • 396
  • 1
  • 5
  • 21
5
votes
2 answers

Is there something similar to the selenium grid when using cucumber/capybara?

So I'm trying to get an environment set up that acts like a selenium grid in that: 1) It runs the tests in parallel across a distributed set of clients 2) I can specify tests to run on specific clients (which are running on different OS's, with…
bergyman
  • 4,480
  • 3
  • 23
  • 32
5
votes
0 answers

Selenium Node driver.manage().window().setPosition(new Point(X,Y)); Not having any effect

So I am running a simple enough Selenium program through the GRID. I have Grid and Node all setup working perfectly. The issue I am having is with the below : driver.manage().window().setPosition(new Point(X,Y)); This appears to have zero…
5
votes
1 answer

Selenium GRID -- Session terminated due to TIMEOUT after less then 100 milliseconds when invoking WebDriver.getCurrentUrl()

I have a set of parallel tests which never have this problem when I run them locally. This only occurs on my piddly little two node grid. My tests are pretty consistently crapping out when I am trying to invoke WebDriver.getCurrentUrl(). The error…
Selena
  • 2,208
  • 8
  • 29
  • 49
5
votes
0 answers

Selenium WebDriver - Session was terminated due to CLIENT_GONE

I am using Selenium WebDriver to run a suite of tests in the grid mode. When I run all the test and if it is ALL PASS, I have no issues with the test suite. But if a test fail say in a suite of 200 tests, if test 121 failed, all the remaining test…
5
votes
1 answer

How to execute cucumber test cases in parallel using Grid?

After doing a fair amount of research on how to run Cucumber test cases in parallel, I found the following very useful article on the subject matter: https://www.opencredo.com/2013/07/02/running-cucumber-jvm-tests-in-parallel/ The article has some…
5
votes
1 answer

Manage Selenium Grid queue

I have 1 grid hub server and 3 selenium nodes. I would like to execute multiple test suite against one Grid Hub server. So that each test suite will be executed on all 3 servers and the rest of the test suits (pending) will wait till the current…
5
votes
4 answers

Is it best practice to use Thread.sleep() or explicit wait before click on any element in selenium web driver

I am new to web driver and I wrote a selenium script for web application which contains backbone.js and select2. I used to get NosuchElementException and Element is not clickable exceptions often. So I have decided to script as below, - before…
Jugi
  • 1,244
  • 3
  • 23
  • 51
5
votes
4 answers

org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms

I am facing issue while executing the selenium scripts in firefox browser. Console Error: org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms Build info: version: '2.39.0', revision:…
Khalith Basha
  • 101
  • 1
  • 2
  • 12
5
votes
2 answers

Is it possible to configure Selenium 2 Grid to log a client ipaddress

I have a small grid running and a couple of teams in my organization are using it. I'd like to know from which teams grid requests are originating from. I can't find any client info in the current grid logs. Can i configure log4j? Or do i need to…
Ivo Grootjes
  • 612
  • 3
  • 8