You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An easy way to override [seleniumbase/config/settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py) is by using a custom settings file.
175
-
Here's the command-line option to add to tests: (See [examples/custom_settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/custom_settings.py))
176
-
``--settings-file=custom_settings.py``
177
-
(Settings include default timeout values, a two-factor auth key, DB credentials, S3 credentials, and other important settings used by tests.)
<h3><imgsrc="https://seleniumbase.io/img/logo6.png"title="SeleniumBase"width="28" /> Running tests on a remote Selenium Grid:</h3>
176
+
There are times when you'll want to combine various command-line options for added effect.
177
+
For instance, the multi-process option, ``-n=4``, can be customized by adding:
178
+
``--dist=loadscope`` or ``--dist=loadfile`` to it.
179
+
Here's more info on that, as taken from [pytest-xdist](https://pypi.org/project/pytest-xdist/):
180
180
181
-
SeleniumBase lets you run tests on remote Selenium Grids such as [BrowserStack](https://www.browserstack.com/automate#)'s Selenium Grid, [Sauce Labs](https://saucelabs.com/products/open-source-frameworks/selenium)'s Selenium Grid, [TestingBot](https://testingbot.com/features)'s Selenium Grid, other Grids, and even your own Grid:
181
+
*``-n=4 --dist=loadscope``: Tests are grouped by module for test functions and by class for test methods. Groups are distributed to available workers as whole units. This guarantees that all tests in a group run in the same process. This can be useful if you have expensive module-level or class-level fixtures. Grouping by class takes priority over grouping by module.
182
182
183
-
(For setting browser desired capabilities while running Selenium remotely, see the ReadMe located here: https://github.com/seleniumbase/SeleniumBase/tree/master/examples/capabilities)
183
+
*``-n=4 --dist=loadfile``: Tests are grouped by their containing file. Groups are distributed to available workers as whole units. This guarantees that all tests in a file run in the same worker.
184
184
185
-
Here's how to connect to a BrowserStack Selenium Grid server for running tests:
185
+
You might also want to combine multiple different options at once. For example:
Or you can create your own Selenium Grid for test distribution. ([See this ReadMe for details](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/utilities/selenium_grid/ReadMe.md))
216
-
217
-
To use a server on the ``https`` protocol, add ``--protocol=https``:
The above not only runs tests in parallel processes, but it also tells tests in the same process to share the same browser session, runs the tests in headless mode, displays the full name of each test on a separate line, creates a realtime dashboard of the test results, and creates a full report after all tests complete.
222
192
223
193
<h3><imgsrc="https://seleniumbase.io/img/logo6.png"title="SeleniumBase"width="28" /> Example tests using Logging:</h3>
An easy way to override [seleniumbase/config/settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py) is by using a custom settings file.
326
+
Here's the command-line option to add to tests: (See [examples/custom_settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/custom_settings.py))
327
+
``--settings-file=custom_settings.py``
328
+
(Settings include default timeout values, a two-factor auth key, DB credentials, S3 credentials, and other important settings used by tests.)
329
+
330
+
--------
331
+
332
+
<h3><imgsrc="https://seleniumbase.io/img/logo6.png"title="SeleniumBase"width="28" /> Running tests on a remote Selenium Grid:</h3>
333
+
334
+
SeleniumBase lets you run tests on remote Selenium Grids such as [BrowserStack](https://www.browserstack.com/automate#)'s Selenium Grid, [Sauce Labs](https://saucelabs.com/products/open-source-frameworks/selenium)'s Selenium Grid, [TestingBot](https://testingbot.com/features)'s Selenium Grid, other Grids, and even your own Grid:
335
+
336
+
(For setting browser desired capabilities while running Selenium remotely, see the ReadMe located here: https://github.com/seleniumbase/SeleniumBase/tree/master/examples/capabilities)
337
+
338
+
Here's how to connect to a BrowserStack Selenium Grid server for running tests:
Or you can create your own Selenium Grid for test distribution. ([See this ReadMe for details](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/utilities/selenium_grid/ReadMe.md))
369
+
370
+
To use a server on the ``https`` protocol, add ``--protocol=https``:
<h3><imgsrc="https://seleniumbase.io/img/logo6.png"title="SeleniumBase"width="28" /> Using a Proxy Server:</h3>
354
379
355
380
If you wish to use a proxy server for your browser tests (Chromium or Firefox), you can add ``--proxy=IP_ADDRESS:PORT`` as an argument on the command line.
0 commit comments