Skip to content
Permalink
 
 
Cannot retrieve contributors at this time
executable file 78 lines (57 sloc) 3.5 KB

The Selenium Grid Hub:

The Selenium Grid Hub lets you distribute tests to run in parallel across multiple node machines. Each node machine can then run its own allocation of tests. This allows you to run a large suite of tests very quickly.

Running the Selenium Grid Hub:

The following commands will work once you've installed seleniumbase.

Downloading the Selenium Server JAR file:

seleniumbase download server
  • (Required for using your own Selenium Grid)

Grid Hub server controls:

seleniumbase grid-hub {start|stop|restart} [OPTIONS]

Options:

  • -v / --verbose (Increases verbosity of logging output.)
  • --timeout=TIMEOUT (Close idle browser after TIMEOUT sec.)

Grid node server controls:

seleniumbase grid-node {start|stop|restart} --hub=[HUB_IP] [OPTIONS]

Options:

  • -v / --verbose (Increases verbosity of logging output.)
  • --hub=[HUB_IP] (Specifies the Grid Hub to connect to. Default: "127.0.0.1".)

When the Grid Hub Console is up and running, you'll be able to find it here: http://127.0.0.1:4444/grid/console

Now you can run your tests on the Selenium Grid:

pytest test_suite.py --server=IP_ADDRESS --port=4444

You can also run your tests on someone else's Selenium Grid to avoid managing your own. Here are some Selenium Grids that you can use (and the run command format):

pytest my_first_test.py --server=USERNAME:KEY@hub.browserstack.com --port=80
pytest my_first_test.py --server=USERNAME:KEY@ondemand.saucelabs.com --port=80
pytest my_first_test.py --server=USERNAME:KEY@hub.testingbot.com --port=80
pytest my_first_test.py --server=USERNAME:KEY@hub.crossbrowsertesting.com --port=80
pytest my_first_test.py --server=USERNAME:KEY@hub.lambdatest.com --port=80

(For setting browser desired capabilities while running Selenium remotely, see the desired capabilities documentation and the sample files located in SeleniumBase/examples/capabilities)

More info about the Selenium Grid Hub can be found here:

* [https://github.com/SeleniumHQ/selenium/wiki/Grid2](https://github.com/SeleniumHQ/selenium/wiki/Grid2)
You can’t perform that action at this time.