Skip to content

Add ability to download browsers (not just drivers) with the sbase get command #3450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mdmintz opened this issue Jan 24, 2025 · 1 comment · Fixed by #3452
Closed

Add ability to download browsers (not just drivers) with the sbase get command #3450

mdmintz opened this issue Jan 24, 2025 · 1 comment · Fixed by #3452
Assignees

Comments

@mdmintz
Copy link
Member

mdmintz commented Jan 24, 2025

Add ability to download browsers (not just drivers) with the sbase get command.


Browser Binaries:

🎛️ Use the sbase get command to download the Chrome for Testing and Chrome-Headless-Shell browser binaries. Example:

sbase get cft  # (For `Chrome for Testing`)
sbase get chs  # (For `Chrome-Headless-Shell`)

Those commands download those binaries into the seleniumbase/drivers folder.
To use the binaries from there in SeleniumBase scripts, set the binary_location to cft or chs.

See https://googlechromelabs.github.io/chrome-for-testing/ for info about Chrome for Testing and Chrome-Headless-Shell.


Setting the binary location:

🔵 By default, SeleniumBase uses the browser binary detected on the System PATH.

🎛️ To change this default behavior, you can use:

pytest --binary-location=PATH

The PATH in --binary-location=PATH / --bl=PATH can be:

  • A relative or exact path to the browser binary.
  • "cft" as a special option for Chrome for Testing.
  • "chs" as a special option for Chrome-Headless-Shell.

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

With the SB() and Driver() formats, the binary location is set via the binary_location parameter.

@mdmintz
Copy link
Member Author

mdmintz commented Jan 25, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant