Skip to content

Remote desired capabilities

Compare
Choose a tag to compare
@mdmintz mdmintz released this 21 Nov 19:49
· 7310 commits to master since this release
493827a

Remote desired capabilities

Allow users to specify browser desired capabilities for webdriver when running SeleniumBase tests on a remote SeleniumGrid server such as BrowserStack, Sauce Labs, or TestingBot.

A sample run command may look like this: (When run from the SeleniumBase/examples/ folder):

pytest my_first_test.py --browser=remote --server=username:[email protected] --port=80 --cap_file=capabilities/sample_cap_file_BS.py

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.)