Skip to content

Allow users to use local driver path instead of WebDriverManager

Compare
Choose a tag to compare
@ElSnoMan ElSnoMan released this 14 Dec 20:26
· 23 commits to master since this release
0e30017

1.12.0 - 2020-12-14

Overview

TL;DR
You can update the new config.driver.local_path field in pylenium.json to the path of your locally installed driver executable. If you don't need this, then nothing has changed for you! Keep using Pylenium as usual.

By default, Pylenium would leverage WebDriverManager to automatically install and manage driver binaries for you. However, some use cases required allowing the user to install and manage their own binaries for more granular control. So, this release handles that by introducing a new field into the pylenium.json

Added

config.driver.local_path

The local_path field is now part of the driver object in pylenium.json:

"driver": {
    "local_path": ""
}

By default, Pylenium will continue automatically installing and managing driver binaries for you unless you override this value.

Examples

Globally set for all tests:

"driver": {
    "local_path": "/path/to/geckodriver.exe"
}

Set for a single test:

def test(py):
    py.config.driver.browser = 'chrome'
    py.config.driver.local_path = '/path/to/chromedriver.exe'
    py.visit("https://example.com")
    ...