[py] Allow driver path to be set using ENV variables#14528
Conversation
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨
|
8ed0f37 to
2a63e21
Compare
Follow up to PR SeleniumHQ#14528, to avoid `os.getenv` raising `TypeError` in `env_path` when `driver_path_env_key` is not passed to `Service` constructor.
Follow up to PR SeleniumHQ#14528, to avoid `os.getenv` raising `TypeError` in `env_path` when `driver_path_env_key` is not passed to `Service` constructor.
[py] Avoid os.getenv error if driver_path_env_key is not set Follow up to PR #14528, to avoid `os.getenv` raising `TypeError` in `env_path` when `driver_path_env_key` is not passed to `Service` constructor. Co-authored-by: Diego Molina <diemol@users.noreply.github.com>
[py] Avoid os.getenv error if driver_path_env_key is not set Follow up to PR SeleniumHQ#14528, to avoid `os.getenv` raising `TypeError` in `env_path` when `driver_path_env_key` is not passed to `Service` constructor. Co-authored-by: Diego Molina <diemol@users.noreply.github.com>
--------- Co-authored-by: Sri Harsha <12621691+harsha509@users.noreply.github.com>
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Allows using custom driver paths using ENV variables
Implements the functionality from the Ruby port in commit 7602371#diff-076503247734547bc24938fcc3aa2b317890093dae9376e32ac9b1e41b7037f9
Motivation and Context
As explained in #14045 the goal of this PR is to provide users with an alternative option to set the path to their own drivers if they do not want to use selenium manager
Types of changes
Checklist
PS: Thanks to @Animesh-Ghosh and @aguspe for the help 🚀
PR Type
Enhancement, Tests
Description
driver_path_env_keyto specify the environment variable key for driver paths.env_pathmethod in theServiceclass to fetch driver paths from environment variables.Changes walkthrough 📝
10 files
service.py
Add environment variable support for ChromeDriver pathpy/selenium/webdriver/chromium/service.py
driver_path_env_keyparameter to the constructor.webdriver.py
Use environment variable for Chromium driver pathpy/selenium/webdriver/chromium/webdriver.py
service.py
Implement environment variable path support in Servicepy/selenium/webdriver/common/service.py
driver_path_env_keyparameter to the constructor.env_pathmethod to fetch path from environment variable.service.py
Add environment variable support for EdgeDriver pathpy/selenium/webdriver/edge/service.py
driver_path_env_keyparameter to the constructor.service.py
Add environment variable support for GeckoDriver pathpy/selenium/webdriver/firefox/service.py
driver_path_env_keyparameter to the constructor.webdriver.py
Use environment variable for Firefox driver pathpy/selenium/webdriver/firefox/webdriver.py
service.py
Add environment variable support for IEDriver pathpy/selenium/webdriver/ie/service.py
driver_path_env_keyparameter to the constructor.webdriver.py
Use environment variable for IE driver pathpy/selenium/webdriver/ie/webdriver.py
service.py
Add environment variable support for SafariDriver pathpy/selenium/webdriver/safari/service.py
driver_path_env_keyparameter to the constructor.webdriver.py
Use environment variable for Safari driver pathpy/selenium/webdriver/safari/webdriver.py
2 files
chrome_service_tests.py
Add tests for ChromeDriver path from environment variablepy/test/selenium/webdriver/chrome/chrome_service_tests.py
firefox_service_tests.py
Add tests for GeckoDriver path from environment variablepy/test/selenium/webdriver/firefox/firefox_service_tests.py