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

Networking between services and job script in a gitlab-ci files

I have this job in my ci runner. It works if I use Selenium-Standalone-Chrome. But Was trying to get Hubs and Nodes working so I can test more browsers. But I'm having trouble getting the services to connect to each other. verify_last_chrome_func: …
Cynic
  • 6,779
  • 2
  • 30
  • 49
3
votes
1 answer

Monitor and gracefully kill or reuse zombie GeckoDriver instances

Selenium is designed to kill Geckodriver process when disposing of the webdriver instance like this: driver.quit(). In my testing framework, I have configured to call driver.quit() after each test. In some cases however, the test terminates…
Eugene S
  • 6,709
  • 8
  • 57
  • 91
3
votes
1 answer

Exception "Was passed main parameter 'webdriver' but no main parameter was defined Error while creating note

I have gone through the video deeply and tried it but I am struck, please help. 1) I tried the code but i getting error of: org.openqa.selenium.SessionNotCreatedException: Unable to create new service: EdgeDriverService Errors Image So then…
3
votes
2 answers

Alternative to mounting /dev/shm volume in Selenium Grid AWS Fargate setup

Because AWS Fargate is stateless and does not currently support any sort of persistence (that I know of or was able to find), I am running into an issue with my Selenium Grid setup. When I had the grid running in Docker, I did what most people seem…
Mike B.
  • 65
  • 11
3
votes
3 answers

Screenshots having different sizes on different PCs in Selenium Grid

I am performing the cross browser testing of a GWT web application on different PCs using Selenium Grid. The problem which I am facing is that the size of generated screenshots (taken during the tests) is different for different PCs and I want to…
KhiladiBhaiyya
  • 633
  • 1
  • 14
  • 43
3
votes
2 answers

Java Selenium: error: cannot access MutableCapabilities

Trying to update our code to Selenium 3.x, and I keep running into an error being thrown when I'm trying to run our tests: error: cannot access MutableCapabilities This same code used to work as far as running the tests, and I'm not really sure…
Teresa
  • 91
  • 2
  • 7
3
votes
1 answer

Jenkins Slave Connection Timeout When Connecting

Last week I set up a selenium grid using jenkins and 4 slave windows VMs. As part of doing this I had to unblock ports for both the slave connection and the selenium connection. The vms downloaded the jnlp starter and registered correctly and by…
Driver
  • 317
  • 1
  • 4
  • 18
3
votes
3 answers

com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON while registering Selenium Grid Node to Hub

i installed selenium-server-standalone-3.4.0.jar and run following command(as hube) on my machine A: java -jar selenium-server-standalone-3.4.0.jar -role hub it runs successfuly. then, on my machine B(as node) run following command: java -jar…
Mahsum Akbas
  • 1,523
  • 3
  • 21
  • 38
3
votes
1 answer

Selenium Python test against Selenium grid created from SeleniumHQ Docker images

In brief How to run Python Selenium tests properly against Selenium Grid container created from SeleniumHQ Docker images? I also asked on SeleniumHQ here https://github.com/SeleniumHQ/docker-selenium/issues/521 The error & log 00 - the console…
Nam G VU
  • 33,193
  • 69
  • 233
  • 372
3
votes
2 answers

Selenium; How to run multiple instances and maintain different session

I know we can run tests in multiple browsers using testng and selenium grid. But, the problem am facing is, Second browser is taking the logged in session of first browser. I mean, I need to sign in to an web-application and do some functional flow…
Jeyabal
  • 71
  • 1
  • 4
3
votes
2 answers

remote execution in sikuli

I have an integrated selenium/sikuili automation project which I would like to run on windows agent here is the scenario: Machine (A) contains the source code Machine (B) is the agent test runner machine that has selenium grid running on it, when…
Ali Hamadi
  • 673
  • 3
  • 11
  • 26
3
votes
1 answer

API for getting the selenium nodes status from the grid host

Sorry for the generic question, but is there an api that is available as part of the selenium grid that i can query to find out the current active sessions on the grid. There is an api that uses the Json Wire protocol that enables to query the…
trial999
  • 1,646
  • 6
  • 21
  • 36
3
votes
3 answers

Unable to create new Chrome remote session

I'm trying to launch a new Chrome browser using Selenium Grid but ending up with the below error Unable to create new remote session. desired capabilities = Capabilities [{browserName=chrome, version=55.0.2, platform=WINDOWS}], required capabilities…
3
votes
2 answers

Not able to run more than 10 Tests in parallel via TestNG Dataprovider

Hi i have designed a selenium test to run in parallel (25) @Test(dataProvider = "getData" ) public void multiUserTest(String url, String username, String password) throws InterruptedException, IOException, FindFailed { …
3
votes
1 answer

Find which node my selenium-grid remote driver is running on?

I obtain a RemoteWebDriver from the hub as follows: RemoteWebDriver driver = new RemoteWebDriver( new URL("http://whatever:4444/wd/hub"), …
WW.
  • 23,793
  • 13
  • 94
  • 121