Update the desired capabilities ReadMe
This commit is contained in:
parent
f1fbaea375
commit
b324f716b8
|
@ -8,7 +8,7 @@ A sample run command may look like this when run from the [SeleniumBase/examples
|
|||
pytest my_first_test.py --browser=remote --server=username:key@hub.browserstack.com --port=80 --cap_file=capabilities/sample_cap_file_BS.py
|
||||
```
|
||||
|
||||
(You'll need to specify ``--server=SERVER``, ``--port=PORT``, and ``--cap_file=CAP_FILE.py``)
|
||||
(Parameters: ``--browser=remote``, ``--server=SERVER``, ``--port=PORT``, and ``--cap_file=CAP_FILE.py``)
|
||||
|
||||
Here's an example desired capabilities file:
|
||||
```python
|
||||
|
@ -31,11 +31,13 @@ caps['platform'] = "macOS 10.12"
|
|||
caps['version'] = "70.0"
|
||||
```
|
||||
|
||||
You can generate desired capabilities for [BrowserStack](https://www.browserstack.com/automate/capabilities), [Sauce Labs](https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/), and [TestingBot](https://testingbot.com/support/other/test-options) by following the links to their websites.
|
||||
(You'll notice that the browser is now being specified in the capabilities file, rather than with ``--browser=BROWSER``)
|
||||
|
||||
You can generate desired capabilities for [BrowserStack](https://www.browserstack.com/automate/capabilities), [Sauce Labs](https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/), and [TestingBot](https://testingbot.com/support/other/test-options) by following those links to their respective websites.
|
||||
|
||||
A regex parser was built into SeleniumBase to capture all lines from the specified desired capabilities file in the following formats:
|
||||
``'KEY': 'VALUE'``
|
||||
``caps['KEY'] = "VALUE"``
|
||||
(Each pair must be on a separate line. You can interchange single and double quotes.)
|
||||
|
||||
You can also swap ``--browser=remote`` with an actual browser, eg ``--browser=chrome``, which will combine the default SeleniumBase desired capabilities with those that were specified in the capabilities file when using ``--cap_file=FILE.py``. (For example, you'll need default SeleniumBase desired capabilities when using a proxy server, which is not the same as the Selenium Grid server.)
|
||||
You can also swap ``--browser=remote`` with an actual browser, eg ``--browser=chrome``, which will combine the default SeleniumBase desired capabilities with those that were specified in the capabilities file when using ``--cap_file=FILE.py``. Capabilities will override other parameters, so if you set the browser to one thing and the capabilities browser to another, SeleniumBase will use the capabilities browser as the browser. You'll need default SeleniumBase desired capabilities when using a proxy server (not the same as a Selenium Grid server), when downloading files to a desired folder, for disabling some warnings on Chrome, for overriding a website's Content Security Policy on Firefox, and for other reasons.
|
Loading…
Reference in New Issue