Skip to content

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

Closed
@mdmintz

Description

@mdmintz

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions