Skip to content

Commit 2a69f3f

Browse files
committed
Add a ReadMe file for using desired capabilities with SeleniumBase
1 parent fd6e053 commit 2a69f3f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

examples/capabilities/ReadMe.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
### Using Desired Capabilities
2+
3+
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).
4+
5+
A sample run command may look like this: (When run from the ``SeleniumBase/examples/`` folder):
6+
7+
```bash
8+
pytest my_first_test.py --browser=remote --server=username:[email protected] --port=80 --cap_file=capabilities/sample_cap_file_BS.py
9+
```
10+
11+
A regex parser was built into SeleniumBase to capture all lines from the specified desired capabilities file in the following formats:
12+
``'KEY': 'VALUE'``
13+
``caps['KEY'] = "VALUE"``
14+
(Each pair must be on a separate line. You can interchange single and double quotes.)
15+
16+
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.)

0 commit comments

Comments
 (0)