Update the docs

This commit is contained in:
Michael Mintz 2021-09-06 12:58:41 -04:00
parent a5d90cebdb
commit dcae21dead
5 changed files with 32 additions and 32 deletions

View File

@ -21,5 +21,5 @@ mkdocs==1.2.2;python_version>="3.6"
mkdocs-material==7.1.3;python_version>="3.6"
mkdocs-exclude-search==0.5.2;python_version>="3.6"
mkdocs-simple-hooks==0.1.3
mkdocs-material-extensions==1.0.1;python_version>="3.6"
mkdocs-material-extensions==1.0.3;python_version>="3.6"
mkdocs-minify-plugin==0.4.0

View File

@ -1,15 +1,15 @@
### <img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="30" /> Using Desired Capabilities
### <img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="28" /> Using Desired Capabilities
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).
Sample run commands may look like this when run from the [SeleniumBase/examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) folder: (The browser is now specified in the capabilities file.)
```bash
pytest my_first_test.py --browser=remote --server=USERNAME:KEY@hub.browserstack.com --port=80 --cap_file=capabilities/sample_cap_file_BS.py
pytest test_demo_site.py --browser=remote --server=USERNAME:KEY@hub.browserstack.com --port=80 --cap_file=capabilities/sample_cap_file_BS.py
```
```bash
pytest my_first_test.py --browser=remote --server=USERNAME:KEY@ondemand.saucelabs.com --port=80 --cap_file=capabilities/sample_cap_file_SL.py
pytest test_demo_site.py --browser=remote --server=USERNAME:KEY@ondemand.us-east-1.saucelabs.com --port=443 --protocol=https --cap_file=capabilities/sample_cap_file_SL.py
```
(Parameters: ``--browser=remote``, ``--server=SERVER``, ``--port=PORT``, and ``--cap_file=CAP_FILE.py``)

View File

@ -344,31 +344,31 @@ SeleniumBase lets you run tests on remote Selenium Grids such as [BrowserStack](
Here's how to connect to a BrowserStack Selenium Grid server for running tests:
```bash
pytest my_first_test.py --server=USERNAME:KEY@hub.browserstack.com --port=80
pytest test_demo_site.py --server=USERNAME:KEY@hub.browserstack.com --port=80
```
Here's how to connect to a Sauce Labs Selenium Grid server for running tests:
```bash
pytest my_first_test.py --server=USERNAME:KEY@ondemand.saucelabs.com --port=80
pytest test_demo_site.py --server=USERNAME:KEY@ondemand.us-east-1.saucelabs.com --port=443 --protocol=https
```
Here's how to connect to a TestingBot Selenium Grid server for running tests:
```bash
pytest my_first_test.py --server=USERNAME:KEY@hub.testingbot.com --port=80
pytest test_demo_site.py --server=USERNAME:KEY@hub.testingbot.com --port=80
```
Here's how to connect to a CrossBrowserTesting Selenium Grid server for running tests:
```bash
pytest my_first_test.py --server=USERNAME:KEY@hub.crossbrowsertesting.com --port=80
pytest test_demo_site.py --server=USERNAME:KEY@hub.crossbrowsertesting.com --port=80
```
Here's how to connect to a LambdaTest Selenium Grid server for running tests:
```bash
pytest my_first_test.py --server=USERNAME:KEY@hub.lambdatest.com --port=80
pytest test_demo_site.py --server=USERNAME:KEY@hub.lambdatest.com --port=80
```
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))
@ -376,7 +376,7 @@ Or you can create your own Selenium Grid for test distribution. ([See this ReadM
To use a server on the ``https`` protocol, add ``--protocol=https``:
```bash
pytest test_suite.py --protocol=https --server=IP_ADDRESS --port=PORT
pytest test_demo_site.py --protocol=https --server=IP_ADDRESS --port=PORT
```
--------

View File

@ -200,16 +200,15 @@ self.switch_to_default_window()
self.switch_to_newest_window()
self.get_new_driver(
browser=None, headless=None, locale_code=None,
servername=None, port=None, proxy=None, agent=None,
switch_to=True, cap_file=None, cap_string=None,
disable_csp=None, enable_ws=None, enable_sync=None,
use_auto_ext=None, no_sandbox=None, disable_gpu=None,
incognito=None, guest_mode=None,
devtools=None, remote_debug=None,
swiftshader=None, block_images=None, user_data_dir=None,
extension_zip=None, extension_dir=None, is_mobile=None,
d_width=None, d_height=None, d_p_r=None)
browser=None, headless=None, locale_code=None, protocol=None,
servername=None, port=None, proxy=None, agent=None, switch_to=True,
cap_file=None, cap_string=None, disable_csp=None, enable_ws=None,
enable_sync=None, use_auto_ext=None, no_sandbox=None, disable_gpu=None,
incognito=None, guest_mode=None, devtools=None, remote_debug=None,
swiftshader=None, block_images=None,
chromium_arg=None, firefox_arg=None, firefox_pref=None,
user_data_dir=None, extension_zip=None, extension_dir=None,
is_mobile=None, d_width=None, d_height=None, d_p_r=None)
self.switch_to_driver(driver)

View File

@ -1,14 +1,14 @@
[<img src="https://seleniumbase.io/cdn/img/super_logo_sb.png" title="SeleniumBase" width="290">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
<h2><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="30" /> The Selenium Grid Hub:</h2>
<h2><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="28" /> The Selenium Grid Hub:</h2>
The Selenium Grid Hub lets you distribute tests to run in parallel across multiple node machines. Each node machine can then run its own allocation of tests. This allows you to run a large suite of tests very quickly.
<h3><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="30" /> Running the Selenium Grid Hub:</h3>
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="28" /> Running the Selenium Grid Hub:</h3>
The following commands will work once you've installed seleniumbase.
<h4><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="30" /> Downloading the Selenium Server JAR file:</h4>
<h4><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="28" /> Downloading the Selenium Server JAR file:</h4>
```bash
seleniumbase download server
@ -16,7 +16,7 @@ seleniumbase download server
* (Required for using your own Selenium Grid)
<h4><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="30" /> Grid Hub server controls:</h4>
<h4><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="28" /> Grid Hub server controls:</h4>
```bash
seleniumbase grid-hub {start|stop|restart} [OPTIONS]
@ -28,7 +28,7 @@ seleniumbase grid-hub {start|stop|restart} [OPTIONS]
<li> --timeout=TIMEOUT (Close idle browser after TIMEOUT sec.)</li>
</ul>
<h4><img src="https://seleniumbase.io/img/sb_icon.png" title="SeleniumBase" width="30" /> Grid node server controls:</h4>
<h4><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="28" /> Grid node server controls:</h4>
```bash
seleniumbase grid-node {start|stop|restart} --hub=[HUB_IP] [OPTIONS]
@ -45,7 +45,7 @@ When the Grid Hub Console is up and running, you'll be able to find it here: [ht
Now you can run your tests on the Selenium Grid:
```bash
pytest test_suite.py --server=IP_ADDRESS --port=4444
pytest test_demo_site.py --server=IP_ADDRESS --port=4444
```
You can also run your tests on someone else's Selenium Grid to avoid managing your own. Here are some Selenium Grids that you can use (and the run command format):
@ -53,37 +53,38 @@ You can also run your tests on someone else's Selenium Grid to avoid managing yo
* [BrowserStack](https://www.browserstack.com/automate#) Selenium Grid:
```bash
pytest my_first_test.py --server=USERNAME:KEY@hub.browserstack.com --port=80
pytest test_demo_site.py --server=USERNAME:KEY@hub.browserstack.com --port=80
```
* [Sauce Labs](https://saucelabs.com/products/open-source-frameworks/selenium) Selenium Grid:
```bash
pytest my_first_test.py --server=USERNAME:KEY@ondemand.saucelabs.com --port=80
pytest test_demo_site.py --server=USERNAME:KEY@ondemand.us-east-1.saucelabs.com --port=443 --protocol=https
```
* [TestingBot](https://testingbot.com/features) Selenium Grid:
```bash
pytest my_first_test.py --server=USERNAME:KEY@hub.testingbot.com --port=80
pytest test_demo_site.py --server=USERNAME:KEY@hub.testingbot.com --port=80
```
* [CrossBrowserTesting](https://help.crossbrowsertesting.com/selenium-testing/getting-started/python/) Selenium Grid:
```bash
pytest my_first_test.py --server=USERNAME:KEY@hub.crossbrowsertesting.com --port=80
pytest test_demo_site.py --server=USERNAME:KEY@hub.crossbrowsertesting.com --port=80
```
* [LambdaTest](https://www.lambdatest.com/selenium-automation) Selenium Grid:
```bash
pytest my_first_test.py --server=USERNAME:KEY@hub.lambdatest.com --port=80
pytest test_demo_site.py --server=USERNAME:KEY@hub.lambdatest.com --port=80
```
To use a server on the ``https`` protocol, add ``--protocol=https``:
(<i>SeleniumBase 1.65.2 and newer uses ``https`` automatically for ``--port=443``.</i>)
```bash
pytest test_suite.py --protocol=https --server=IP_ADDRESS --port=PORT
pytest test_demo_site.py --protocol=https --server=IP_ADDRESS --port=PORT
```
(For setting browser desired capabilities while running Selenium remotely, see the <a href="https://seleniumbase.io/help_docs/desired_capabilities/">desired capabilities documentation</a> and the sample files located in <a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/capabilities">SeleniumBase/examples/capabilities</a>)