Skip to content

Commit a44a1d5

Browse files
committed
Add support for downloading browsers
1 parent 7c21383 commit a44a1d5

File tree

7 files changed

+325
-29
lines changed

7 files changed

+325
-29
lines changed

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,20 @@ msedgedriver.exe
8282
operadriver.exe
8383
uc_driver.exe
8484

85+
# Chrome for Testing folders
86+
chrome-mac-arm64
87+
chrome-mac-x64
88+
chrome-linux64
89+
chrome-win64
90+
chrome-win32
91+
92+
# Chrome-Headless-Shell folders
93+
chrome-headless-shell-mac-arm64
94+
chrome-headless-shell-mac-x64
95+
chrome-headless-shell-linux64
96+
chrome-headless-shell-win64
97+
chrome-headless-shell-win32
98+
8599
# msedgedriver requirements
86100
libc++.dylib
87101

help_docs/webdriver_installation.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
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.
66

7-
You can also download drivers manually with these commands:
7+
🎛️ You can also download drivers manually with these commands:
88

99
```bash
1010
seleniumbase get chromedriver
@@ -16,7 +16,7 @@ After running the commands above, web drivers will get downloaded into the `sele
1616

1717
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.
1818

19-
* You can also download specific versions of drivers. Examples:
19+
🎛️ You can also download specific versions of drivers. Examples:
2020

2121
```bash
2222
sbase get chromedriver 114
@@ -30,7 +30,7 @@ sbase get chromedriver mlatest # Milestone latest version for detected browser
3030
sbase get edgedriver 115.0.1901.183
3131
```
3232

33-
(NOTE: ``sbase`` is a shortcut for ``seleniumbase``)
33+
(NOTE: `sbase` is a shortcut for `seleniumbase`)
3434

3535
--------
3636

@@ -48,15 +48,15 @@ Here's where you can go to manually get web drivers from the source:
4848

4949
**macOS shortcuts**:
5050

51-
* You can also install drivers by using ``brew`` (aka ``homebrew``):
51+
🎛️ You can also install drivers by using ``brew`` (aka ``homebrew``):
5252

5353
```bash
5454
brew install --cask chromedriver
5555

5656
brew install geckodriver
5757
```
5858

59-
You can also upgrade existing webdrivers:
59+
🎛️ You can also upgrade existing webdrivers:
6060

6161
```bash
6262
brew upgrade --cask chromedriver
@@ -66,7 +66,7 @@ brew upgrade geckodriver
6666

6767
**Linux shortcuts**:
6868

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:
7070

7171
```bash
7272
wget https://chromedriver.storage.googleapis.com/114.0.5735.90/chromedriver_linux64.zip
@@ -76,12 +76,30 @@ chmod +x /usr/local/bin/chromedriver
7676
```
7777

7878
```bash
79-
wget https://github.com/mozilla/geckodriver/releases/download/v0.34.0/geckodriver-v0.34.0-linux64.tar.gz
80-
tar xvfz geckodriver-v0.34.0-linux64.tar.gz
79+
wget https://github.com/mozilla/geckodriver/releases/download/v0.35.0/geckodriver-v0.35.0-linux64.tar.gz
80+
tar xvfz geckodriver-v0.35.0-linux64.tar.gz
8181
mv geckodriver /usr/local/bin/
8282
chmod +x /usr/local/bin/geckodriver
8383
```
8484

8585
To verify that web drivers are working, **[follow these instructions](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/verify_webdriver.md)**.
8686

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`.
100+
101+
(Source: https://googlechromelabs.github.io/chrome-for-testing/)
102+
103+
--------
104+
87105
[<img src="https://seleniumbase.github.io/cdn/img/sb_logo_b.png" title="SeleniumBase" width="280">](https://github.com/seleniumbase/SeleniumBase)

seleniumbase/console_scripts/ReadMe.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@ sbase get chromedriver 114.0.5735.90
6868
sbase get chromedriver stable
6969
sbase get chromedriver beta
7070
sbase get chromedriver -p
71+
sbase get cft 131
72+
sbase get chs
7173
```
7274

73-
(Drivers: ``chromedriver``, ``geckodriver``, ``edgedriver``,
74-
``iedriver``, ``uc_driver``)
75+
(Drivers: ``chromedriver``, ``cft``, ``uc_driver``,
76+
``edgedriver``, ``chs``, ``geckodriver``)
7577

7678
(Options: A specific driver version or major version integer.
7779
If not set, the driver version matches the browser.

seleniumbase/console_scripts/run.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ def show_install_usage():
139139
print(" OR: seleniumbase get [DRIVER_NAME] [OPTIONS]")
140140
print(" OR: sbase install [DRIVER_NAME] [OPTIONS]")
141141
print(" OR: sbase get [DRIVER_NAME] [OPTIONS]")
142-
print(" (Drivers: chromedriver, geckodriver,")
143-
print(" edgedriver, iedriver, uc_driver)")
142+
print(" (Drivers: chromedriver, cft, uc_driver,")
143+
print(" edgedriver, chs, geckodriver)")
144144
print(" Options:")
145145
print(" VERSION Specify the version to download.")
146146
print(" Tries to detect the needed version.")
@@ -157,11 +157,15 @@ def show_install_usage():
157157
print(" sbase get chromedriver stable")
158158
print(" sbase get chromedriver beta")
159159
print(" sbase get chromedriver -p")
160+
print(" sbase get cft 131")
161+
print(" sbase get chs")
160162
print(" Output:")
161163
print(" Downloads the webdriver to seleniumbase/drivers/")
162164
print(" (chromedriver is required for Chrome automation)")
163165
print(" (geckodriver is required for Firefox automation)")
164166
print(" (edgedriver is required for MS__Edge automation)")
167+
print(" (cft is for the `Chrome for Testing` binary exe)")
168+
print(" (chs is for the `Chrome-Headless-Shell` binary.)")
165169
print("")
166170

167171

0 commit comments

Comments
 (0)