Skip to main content

setup-selenium-testing

I get tired of having to rewrite the setup logic for selenium drivers in every project. Time to consolidate.

License PyPI Supported Versions Checked with mypy Code style: black Imports: isort Ruff

Issues

Build Status Build Status Build Status Build Status

Instantiating SetupSelenium

This will automatically handle any downloading of drivers or browsers via SeleniumManager

from setup_selenium import SetupSelenium

s = SetupSelenium(headless=True)
assert s.driver.service.is_connectable()

Advanced usage:

from setup_selenium import Browser, SetupSelenium

s = SetupSelenium(Browser.FIREFOX, headless=True, driver_version="118.0.5993.70")
s = SetupSelenium(Browser.CHROME, headless=True, driver_version="118.0.5993.70",
                  driver_path="/path/to/webdriver"
                  )

[!NOTE] Version and path arguments follow the logic of SeleniumManager. Caution is advised in cases where version and path do not match. See their documentation.

Install Driver only

from setup_selenium import Browser, SetupSelenium

driver_path, browser_path = SetupSelenium.install_driver(Browser.CHROME, driver_version="118.0.5993.70")

Create driver only

from setup_selenium import Browser, SetupSelenium

driver = SetupSelenium.create_driver(browser=Browser.CHROME, headless=True)

Advanced usage:

from setup_selenium import Browser, SetupSelenium

driver = SetupSelenium.create_driver(
    browser=Browser.CHROME,
    headless=True,
    enable_log_performance=False,
    enable_log_console=False,
    enable_log_driver=False,
    log_dir="./logs",
    binary="/usr/bin/chromium",
    driver_path="/usr/bin/chromedriver",
)

[!NOTE] It is possible to enable the performance and console logging but only for chrome based browsers. This only enables the browser ability. It is up to the tester to handle logging the messages.

Custom logger

import logging
from setup_selenium import Browser, SetupSelenium, set_logger

set_logger(logging.getLogger("your_custom_logger"))
driver = SetupSelenium.create_driver(browser=Browser.CHROME, headless=True)

Automatic driver and browser installation

This package not only handles setup of the webdriver but also will automatically install the webdriver and/or browser depending on your configuration.

If you do not provide a driver_path argument to create_driver the package will utilize selenium-manager to install the webdriver for the browser type selected.

If the selenium-manager cannot find the install path for the browser type (which is usually in the native install path) it will download a version of the browser and use that.

Passing a valid binary_path will not trigger any download of the browser. Passing a valid driver_path will not trigger any download of the webdriver.

CHANGELOG

version 1.1.0

  • allow driver options to be passed into SetupSelenium()
  • disabled HttpsFirstBalancedModeAutoEnable in chromium based drivers (by default)

version 1.0.6

  • fixing annotations for selenium 4.41

version 1.0.5

  • updated throttling functions

version 1.0.2

  • removed python 3.8 support

version 1.0.1

  • removed --remote-debugging-pipe from default chrome options (causes older chrome to crash)

version 1.0.0

  • official release

Metadata

Release files for setup-selenium-testing 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for setup-selenium-testing 1.1.0
File Size Uploaded
setup_selenium_testing-1.1.0.tar.gz 11.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for setup-selenium-testing 1.1.0
File Interpreter ABI Platform
setup_selenium_testing-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.2 kB

Release files / setup_selenium_testing-1.1.0.tar.gz

Download URL setup_selenium_testing-1.1.0.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
917449f19262a49db57df71fd72cf37c995edd26572adfda1d0818002dae5f43
BLAKE2b-256 checksum
How to use checksums
a2a6012444115eb8f4f6470499ba15abbe6658ce574e5e68d689266146ee5f5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.

Transparency log

Release files / setup_selenium_testing-1.1.0-py3-none-any.whl

Download URL setup_selenium_testing-1.1.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34f002c3efdcf3eb23d673fa10e8044d1650e0ef2fe4f9b3541d9fd574d3c0c6
BLAKE2b-256 checksum
How to use checksums
df81e74bf786c68c0647796dd032c75390ba665ad1df0b8d583f5801cd61f3bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page