Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🚀 Feature]: Manually invoke Selenium Manager to pre-install webdriver binary in Dockerfile #12168

Closed
calebplum opened this issue Jun 7, 2023 · 4 comments

Comments

@calebplum
Copy link

Feature and motivation

I need to build a custom docker image to run some Python Selenium tests in. I'd like to pre-install the webdriver from inside the Dockerfile to reduce resource consumption at runtime.

With the latest version of Selenium, the easiest way to download the webdriver is to let Selenium handle it via Selenium Manager. However, my understanding is that Selenium Manager is only invoked when a webdriver session is spawned, for example with driver = webdriver.Chrome().

Is there any way to invoke Selenium Manager manually and instruct it to download the corresponding webdriver binary without spawning an instance of the webdriver? In my case this would be performed in my Dockerfile so any method using either Linux shell commands or Python would be suitable.

Usage example

A solution involving either shell command or Python code to download the webdriver binary without actually instantiating the webdriver.

@github-actions
Copy link

github-actions bot commented Jun 7, 2023

@calebplum, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@calebplum calebplum changed the title [🚀 Feature]: Manually invoke Selenium Manager to pre-install webdriver in Dockerfile [🚀 Feature]: Manually invoke Selenium Manager to pre-install webdriver binary in Dockerfile Jun 7, 2023
@titusfortner
Copy link
Member

Right now it would run the first time you created a driver, then use the cached versions for everything after that.

Getting this sorted as part of docker setup is a use case we've talked about. If we release Selenium Manager as a standalone artifact it won't be until we have a stable 1.0 release.

Python code that will work without creating a session:

webdriver.common.driver_finder.DriverFinder.get_path(
        webdriver.chrome.service.Service(),
        webdriver.chrome.options.Options()
)

@titusfortner
Copy link
Member

This is possible now and will be more straightforward with #13022 so no need to track this explicitly here.

@titusfortner titusfortner closed this as not planned Won't fix, can't repro, duplicate, stale Dec 28, 2023
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants