[🚀 Feature]: Use Environment Variables to set driver locations
Feature and motivation
We discussed in the Selenium Dev Summit about having the ability to set driver location system-wide using environment variables, similar to how Java currently uses System Properties.
See #13806
Usage example
If we match Java System Properties, it would look like:
os.environ["WEBDRIVER_GECKO_DRIVER"] = path_to_geckodriver
This is a nit. But why is Java label added to this issue? I might be missing something.
The idea is to leave a path for users who want to avoid Selenium Manager completely. The decision was to implement an env var that the service would use. I guess we can keep the system properties in Java instead of implementing the env var.
I included it intentionally because perhaps Java should look for the System Property and the Environment Variable? Is there a scenario where you have a VM where you want to run multiple bindings and only set things one way? /shrug
Actually, which convention do we want to match?
For instance in Java:
System Property: webdriver.gecko.driver
Java wrapper for property: GeckoDriverService.GECKO_DRIVER_EXE_PROPERTY
Options:
Match property convention: WEBDRIVER_GECKO_DRIVER
Match env convention: SE_GECKODRIVER
I am in favour of having a consistent way across bindings, if that is possible.
Match env convention: SE_GECKODRIVER I think this. But I don't have any strong opinions about this. I would prefer that this is the convention we use for other env variables example: SE_EDGE_PATH. It is might be easier for users to identify/set Selenium related environment variables.
@pujagani @titusfortner I'm working on this hopefully I will put it for review this weekend :)
#14287 added Ruby part and the following variables:
SE_CHROMEDRIVERSE_EDGEDRIVERSE_GECKODRIVERSE_IEDRIVERSE_SAFARIDRIVER
I can work on the Python functionality.
The python part has also been implemented. In https://github.com/SeleniumHQ/selenium/commit/a2cacc197ff0abd7b74b1025bff88090aafe3b37 and uses the same environment variables as Ruby.
This issue is stale because it has been open 280 days with no activity. Remove stale label or comment or this will be closed in 14 days.
I am working on it for Java.