You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above not only runs tests in parallel processes, but it also tells tests in the same process to share the same browser session, runs the tests in headless mode, displays the full name of each test on a separate line, creates a real-time dashboard of the test results, and creates a full report after all tests complete.
339
339
340
+
🎛️ For extra speed, run your tests using `chrome-headless-shell`:
341
+
342
+
First, get `chrome-headless-shell` if you don't already have it:
343
+
344
+
```bash
345
+
sbase get chs
346
+
```
347
+
348
+
Then, run scripts with `binary_location` / `bl` set to `"chs"`:
That makes your tests run very quickly in headless mode.
355
+
340
356
--------
341
357
342
358
<h3><imgsrc="https://seleniumbase.github.io/img/green_logo.png"title="SeleniumBase"width="32" /> The SeleniumBase Dashboard:</h3>
@@ -449,6 +465,27 @@ Note that different options could lead to the same result. (Eg. If you have the
449
465
450
466
--------
451
467
468
+
<h3><imgsrc="https://seleniumbase.github.io/img/green_logo.png"title="SeleniumBase"width="32" /> Setting the binary location:</h3>
469
+
470
+
🔵 By default, SeleniumBase uses the browser binary detected on the System PATH.
471
+
472
+
🎛️ To change this default behavior, you can use:
473
+
474
+
```bash
475
+
pytest --binary-location=PATH
476
+
```
477
+
478
+
The `PATH` in `--binary-location=PATH` / `--bl=PATH` can be:
479
+
* A relative or exact path to the browser binary.
480
+
*`"cft"` as a special option for `Chrome for Testing`.
481
+
*`"chs"` as a special option for `Chrome-Headless-Shell`.
482
+
483
+
Before using the `"cft"` / `"chs"` options, call `sbase get cft` / `sbase get chs` in order to download the specified binaries into the `seleniumbase/drivers` folder. The default version is the latest stable version on https://googlechromelabs.github.io/chrome-for-testing/. You can change that by specifying the arg as a parameter. (Eg. `sbase get cft 131`, `sbase get chs 132`, etc.)
484
+
485
+
With the `SB()` and `Driver()` formats, the binary location is set via the `binary_location` parameter.
🎛️ An easy way to override [seleniumbase/config/settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py) is by using a custom settings file.
Copy file name to clipboardExpand all lines: help_docs/webdriver_installation.md
+26-8
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
To run web automation, you need webdrivers for each browser you plan on using. With SeleniumBase, drivers are downloaded automatically (as needed) into the SeleniumBase `drivers/` folder.
6
6
7
-
You can also download drivers manually with these commands:
7
+
🎛️ You can also download drivers manually with these commands:
8
8
9
9
```bash
10
10
seleniumbase get chromedriver
@@ -16,7 +16,7 @@ After running the commands above, web drivers will get downloaded into the `sele
16
16
17
17
If the necessary driver is not found in this location while running tests, SeleniumBase will instead look for the driver on the System PATH. If the necessary driver is not on the System PATH either, SeleniumBase will automatically attempt to download the required driver.
18
18
19
-
* You can also download specific versions of drivers. Examples:
19
+
🎛️ You can also download specific versions of drivers. Examples:
20
20
21
21
```bash
22
22
sbase get chromedriver 114
@@ -30,7 +30,7 @@ sbase get chromedriver mlatest # Milestone latest version for detected browser
30
30
sbase get edgedriver 115.0.1901.183
31
31
```
32
32
33
-
(NOTE: ``sbase`` is a shortcut for ``seleniumbase``)
33
+
(NOTE: `sbase` is a shortcut for `seleniumbase`)
34
34
35
35
--------
36
36
@@ -48,15 +48,15 @@ Here's where you can go to manually get web drivers from the source:
48
48
49
49
**macOS shortcuts**:
50
50
51
-
* You can also install drivers by using ``brew`` (aka ``homebrew``):
51
+
🎛️ You can also install drivers by using ``brew`` (aka ``homebrew``):
52
52
53
53
```bash
54
54
brew install --cask chromedriver
55
55
56
56
brew install geckodriver
57
57
```
58
58
59
-
You can also upgrade existing webdrivers:
59
+
🎛️ You can also upgrade existing webdrivers:
60
60
61
61
```bash
62
62
brew upgrade --cask chromedriver
@@ -66,7 +66,7 @@ brew upgrade geckodriver
66
66
67
67
**Linux shortcuts**:
68
68
69
-
If you still need drivers, these scripts download ``chromedriver`` and ``geckodriver`` to a Linux machine:
69
+
🎛️ If you still need drivers, these scripts download `chromedriver` and `geckodriver` to a Linux machine:
To verify that web drivers are working, **[follow these instructions](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/verify_webdriver.md)**.
86
86
87
+
--------
88
+
89
+
**Browser Binaries**:
90
+
91
+
🎛️ Use the `sbase get` command to download the `Chrome for Testing` and `Chrome-Headless-Shell` browser binaries. Example:
92
+
93
+
```bash
94
+
sbase get cft # (For `Chrome for Testing`)
95
+
sbase get chs # (For `Chrome-Headless-Shell`)
96
+
```
97
+
98
+
Those commands download those binaries into the `seleniumbase/drivers` folder.
99
+
To use the binaries from there in SeleniumBase scripts, set the `binary_location` to `cft` or `chs`.
0 commit comments