Update the documentation
This commit is contained in:
parent
e15157111a
commit
fbf31d4a7e
|
@ -426,7 +426,7 @@ pytest --settings-file=custom_settings.py
|
|||
|
||||
<h3><img src="https://seleniumbase.github.io/img/green_logo.png" title="SeleniumBase" width="32" /> Running tests on a remote Selenium Grid:</h3>
|
||||
|
||||
🌐 SeleniumBase lets you run tests on remote Selenium Grids such as [BrowserStack](https://www.browserstack.com/automate#)'s Selenium Grid, [LambdaTest](https://www.lambdatest.com/selenium-automation)'s Selenium Grid, [Sauce Labs](https://saucelabs.com/products/open-source-frameworks/selenium)'s Selenium Grid, other Grids, and even your own Grid:
|
||||
🌐 SeleniumBase lets you run tests on remote Selenium Grids such as [BrowserStack](https://www.browserstack.com/automate#)'s Selenium Grid, [Sauce Labs](https://saucelabs.com/products/open-source-frameworks/selenium)'s Selenium Grid, other Grids, and even your own Grid:
|
||||
|
||||
🌐 For setting browser desired capabilities while running Selenium remotely, see the ReadMe located here: https://github.com/seleniumbase/SeleniumBase/tree/master/examples/capabilities
|
||||
|
||||
|
@ -442,24 +442,6 @@ Here's how to connect to a Sauce Labs Selenium Grid server for running tests:
|
|||
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 Perfecto Selenium Grid server for running tests:
|
||||
|
||||
```bash
|
||||
pytest test_demo_site.py --server=USERNAME:KEY@demo.perfectomobile.com/nexperience/perfectomobile --port=443
|
||||
```
|
||||
|
||||
Here's how to connect to a TestingBot Selenium Grid server for running tests:
|
||||
|
||||
```bash
|
||||
pytest test_demo_site.py --server=USERNAME:KEY@hub.testingbot.com --port=80
|
||||
```
|
||||
|
||||
Here's how to connect to a LambdaTest Selenium Grid server for running tests:
|
||||
|
||||
```bash
|
||||
pytest test_demo_site.py --server=USERNAME:KEY@hub.lambdatest.com --port=80
|
||||
```
|
||||
|
||||
Here's how to connect to a CrossBrowserTesting Selenium Grid server for running tests:
|
||||
|
||||
```bash
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## [<img src="https://seleniumbase.github.io/img/logo6.png" title="SeleniumBase" width="32">](https://github.com/seleniumbase/SeleniumBase/) Using Desired Capabilities
|
||||
|
||||
You can specify browser capabilities when running SeleniumBase tests on a remote Selenium Grid server such as <a href="https://www.browserstack.com/automate/capabilities" target="_blank">BrowserStack</a>, <a href="https://www.lambdatest.com/capabilities-generator/" target="_blank">LambdaTest</a>, or <a href="https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/" target="_blank">Sauce Labs</a>.
|
||||
You can specify browser capabilities when running SeleniumBase tests on a remote Selenium Grid server such as <a href="https://www.browserstack.com/automate/capabilities" target="_blank">BrowserStack</a> or <a href="https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/" target="_blank">Sauce Labs</a>.
|
||||
|
||||
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.)
|
||||
|
||||
|
@ -10,10 +10,6 @@ Sample run commands may look like this when run from the [SeleniumBase/examples/
|
|||
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 test_demo_site.py --browser=remote --server=USERNAME:KEY@https://@hub.lambdatest.com --port=80 --protocol=https --cap_file=capabilities/sample_cap_file_LT.py
|
||||
```
|
||||
|
||||
```bash
|
||||
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
|
||||
```
|
||||
|
@ -34,20 +30,6 @@ desired_cap = {
|
|||
}
|
||||
```
|
||||
|
||||
Here's an example desired capabilities file for LambdaTest:
|
||||
|
||||
```python
|
||||
capabilities = {
|
||||
"build" : "your build name",
|
||||
"name" : "your test name",
|
||||
"platform" : "Windows 11",
|
||||
"browserName" : "Chrome",
|
||||
"version" : "101.0",
|
||||
"timezone" : "UTC+05:30",
|
||||
"geoLocation" : "IN",
|
||||
}
|
||||
```
|
||||
|
||||
Here's an example desired capabilities file for Sauce Labs:
|
||||
|
||||
```python
|
||||
|
@ -65,7 +47,6 @@ capabilities = {
|
|||
|
||||
<ul>
|
||||
<li><a href="https://www.browserstack.com/automate/capabilities" target="_blank">BrowserStack desired capabilities</a></li>
|
||||
<li><a href="https://www.lambdatest.com/capabilities-generator/" target="_blank">LambdaTest desired capabilities</a></li>
|
||||
<li><a href="https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/" target="_blank">Sauce Labs desired capabilities</a></li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -3698,14 +3698,13 @@ class BaseCase(unittest.TestCase):
|
|||
raise Exception(
|
||||
'Cannot use "remote" browser driver on localhost!'
|
||||
" Did you mean to connect to a remote Grid server"
|
||||
" such as BrowserStack, LambdaTest, or Sauce Labs?"
|
||||
" such as BrowserStack or Sauce Labs?"
|
||||
' If so, you must specify the "server" and "port"'
|
||||
" parameters on the command line! "
|
||||
"Example: "
|
||||
"--server=user:key@hub.browserstack.com --port=80"
|
||||
)
|
||||
browserstack_ref = "https://browserstack.com/automate/capabilities"
|
||||
lambdatest_ref = "https://www.lambdatest.com/capabilities-generator"
|
||||
sauce_labs_ref = (
|
||||
"https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/"
|
||||
)
|
||||
|
@ -3714,13 +3713,11 @@ class BaseCase(unittest.TestCase):
|
|||
"Need to specify a desired capabilities file when "
|
||||
'using "--browser=remote". Add "--cap_file=FILE". '
|
||||
"File should be in the Python format used by: "
|
||||
"%s, "
|
||||
"%s, OR "
|
||||
"%s "
|
||||
"See SeleniumBase/examples/capabilities/sample_cap_file_BS.py,"
|
||||
" SeleniumBase/examples/capabilities/sample_cap_file_LT.py,"
|
||||
"%s OR %s \n"
|
||||
"(See SeleniumBase/examples/capabilities/sample_cap_file_BS.py"
|
||||
" and SeleniumBase/examples/capabilities/sample_cap_file_SL.py"
|
||||
% (browserstack_ref, lambdatest_ref, sauce_labs_ref)
|
||||
" for examples!)"
|
||||
% (browserstack_ref, sauce_labs_ref)
|
||||
)
|
||||
if browser is None:
|
||||
browser = self.browser
|
||||
|
|
|
@ -272,8 +272,7 @@ def pytest_addoption(parser):
|
|||
dest="cap_file",
|
||||
default=None,
|
||||
help="""The file that stores browser desired capabilities
|
||||
for BrowserStack, LambdaTest, Sauce Labs,
|
||||
and other remote web drivers to use.""",
|
||||
for BrowserStack, Sauce Labs, or other grids.""",
|
||||
)
|
||||
parser.addoption(
|
||||
"--cap_string",
|
||||
|
@ -281,8 +280,7 @@ def pytest_addoption(parser):
|
|||
dest="cap_string",
|
||||
default=None,
|
||||
help="""The string that stores browser desired capabilities
|
||||
for BrowserStack, LambdaTest, Sauce Labs,
|
||||
and other remote web drivers to use.
|
||||
for BrowserStack, Sauce Labs, or other grids.
|
||||
Enclose cap-string in single quotes.
|
||||
Enclose parameter keys in double quotes.
|
||||
Example: --cap-string='{"name":"test1","v":"42"}'""",
|
||||
|
|
|
@ -149,8 +149,7 @@ class SeleniumBrowser(Plugin):
|
|||
dest="cap_file",
|
||||
default=None,
|
||||
help="""The file that stores browser desired capabilities
|
||||
for BrowserStack, LambdaTest, Sauce Labs,
|
||||
and other remote web drivers to use.""",
|
||||
for BrowserStack, Sauce Labs, or other grids.""",
|
||||
)
|
||||
parser.addoption(
|
||||
"--cap_string",
|
||||
|
@ -158,8 +157,7 @@ class SeleniumBrowser(Plugin):
|
|||
dest="cap_string",
|
||||
default=None,
|
||||
help="""The string that stores browser desired capabilities
|
||||
for BrowserStack, LambdaTest, Sauce Labs,
|
||||
and other remote web drivers to use.
|
||||
for BrowserStack, Sauce Labs, or other grids.
|
||||
Enclose cap-string in single quotes.
|
||||
Enclose parameter keys in double quotes.
|
||||
Example: --cap-string='{"name":"test1","v":"42"}'""",
|
||||
|
|
|
@ -64,24 +64,6 @@ pytest test_demo_site.py --server=USERNAME:KEY@hub.browserstack.com --port=80
|
|||
pytest test_demo_site.py --server=USERNAME:KEY@ondemand.us-east-1.saucelabs.com --port=443 --protocol=https
|
||||
```
|
||||
|
||||
* [Perfecto](https://www.perfecto.io/integrations/selenium) Selenium Grid:
|
||||
|
||||
```bash
|
||||
pytest test_demo_site.py --server=USERNAME:KEY@demo.perfectomobile.com/nexperience/perfectomobile --port=443
|
||||
```
|
||||
|
||||
* [TestingBot](https://testingbot.com/features) Selenium Grid:
|
||||
|
||||
```bash
|
||||
pytest test_demo_site.py --server=USERNAME:KEY@hub.testingbot.com --port=80
|
||||
```
|
||||
|
||||
* [LambdaTest](https://www.lambdatest.com/selenium-automation) Selenium Grid:
|
||||
|
||||
```bash
|
||||
pytest test_demo_site.py --server=USERNAME:KEY@hub.lambdatest.com --port=80
|
||||
```
|
||||
|
||||
* [CrossBrowserTesting](https://help.crossbrowsertesting.com/selenium-testing/getting-started/python/) Selenium Grid:
|
||||
|
||||
```bash
|
||||
|
|
Loading…
Reference in New Issue