Skip to content

Commit f1fbaea

Browse files
committed
Update the desired capabilities ReadMe
1 parent 02d1f3c commit f1fbaea

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

examples/capabilities/ReadMe.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,37 @@
22

33
You can specify browser desired capabilities for webdriver when running SeleniumBase tests on a remote SeleniumGrid server such as [BrowserStack](https://www.browserstack.com/automate/capabilities), [Sauce Labs](https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/), or [TestingBot](https://testingbot.com/support/other/test-options).
44

5-
A sample run command may look like this: (When run from the ``SeleniumBase/examples/`` folder):
5+
A sample run command may look like this when run from the [SeleniumBase/examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) folder:
66

77
```bash
88
pytest my_first_test.py --browser=remote --server=username:[email protected] --port=80 --cap_file=capabilities/sample_cap_file_BS.py
99
```
1010

11+
(You'll need to specify ``--server=SERVER``, ``--port=PORT``, and ``--cap_file=CAP_FILE.py``)
12+
13+
Here's an example desired capabilities file:
14+
```python
15+
desired_cap = {
16+
'os': 'OS X',
17+
'os_version': 'Sierra',
18+
'browser': 'Chrome',
19+
'browser_version': '70.0',
20+
'browserstack.local': 'false',
21+
'browserstack.selenium_version': '3.14.0',
22+
'browserstack.chrome.driver': '2.43'
23+
}
24+
```
25+
26+
A desired capabilities file can also look like this:
27+
```python
28+
caps = {}
29+
caps['browserName'] = "chrome"
30+
caps['platform'] = "macOS 10.12"
31+
caps['version'] = "70.0"
32+
```
33+
34+
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.
35+
1136
A regex parser was built into SeleniumBase to capture all lines from the specified desired capabilities file in the following formats:
1237
``'KEY': 'VALUE'``
1338
``caps['KEY'] = "VALUE"``

0 commit comments

Comments
 (0)