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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃殌 Feature]: Document custom Selenium Manager #1492

Open
titusfortner opened this issue Oct 3, 2023 · 8 comments
Open

[馃殌 Feature]: Document custom Selenium Manager #1492

titusfortner opened this issue Oct 3, 2023 · 8 comments

Comments

@titusfortner
Copy link
Member

Feature and motivation

I laid out the steps I think would work for users to build their own Selenium Manager and use it in an architecture we don't support. This should get documented in selenium_manager.

SeleniumHQ/selenium#12651 (comment)

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

@titusfortner, 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.

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

Thank you!

@seidnerj
Copy link

seidnerj commented Jan 1, 2024

This is helpful thanks - there's still the issue of getting the actual drivers for the target architecture (e.g. aarch64) from an "unofficial" repo, I'm not sure if Selenium Manager could be customized that way too. I'd love to stop using webdriver_manager - I had to fork and patch it so it could fetch chrome driver from raspberrypi's repos.

@titusfortner
Copy link
Member Author

Hmmm, let me think through what we ware trying to solve here again

The current recommended solution is not automated:

  1. Manually download browser/driver somewhere
  2. Point to them in your Service / Options instances

If you compile Selenium Manager for your architecture, you can point to it with SE_MANAGER_PATH environment variable and Selenium will use it without complaint.

That will allow Selenium Manager to locate drivers on PATH, but it seems like a very complicated solution when you should be able to search for it in your local code and point to it directly much more easily.

The more interesting option with a custom compiled binary is to also use SE_DRIVER_MIRROR_URL / SE_BROWSER_MIRROR_URL to point to an alternate storage location. This is the one that seems interesting to me as far as being able to download from electron or Raspberry Pi

But I'm not entirely sure how these mirrors work, I think they need to match the same JSON schema? I'm not sure what this looks like in practice, which is part of what I want to see in the documentation.

@bonigarcia is there an easy guide for what SM is looking for schema-wise? What's the minimal example for pointing to a browser/driver?

Does it even make sense to figure out how to get it to point to other known driver sources? I can't think of a way that isn't overly-complicated, have you thought about what this could look like at all?

@seidnerj
Copy link

seidnerj commented Jan 2, 2024

So to make sense of everything, wanted to clarify just in case there's a misunderstanding - there are two separate challenges here:

  1. Fetching/using the correct Selenium Manager executable that fits the target platform/architecture
  2. Fetching/using the correct Driver executable (chrome, gecko, ie etc.) that fits the target platform/architecture

From the Github discussions I read through, it sounds like with precompiled Selenium Manager executables for 1-2 additional architectures, we could cover 99% of the use cases. There are very minimal code changes required (just pointing to the right path), though I understand there's an issue cross compiling automatically.

Regarding the 2nd issue, I am not familiar with how Selenium Manager works, but if it works anything like its webdriver_manager (Python), it shouldn't be such complex code change - we could let the user provide code that provides a repo url, architecture, platform and filename template.

I am not familiar with Rust but will try to take a look in Selenium Manger's code later and see if I can help.

@titusfortner
Copy link
Member Author

  1. We can't easily compile for any additional architectures with our current implementation
  2. Even if we have a Selenium Manager for the architecture, which binaries to download from where is not obvious and would cause complications in the existing code, so giving someone something pre-compiled but that they can't use out of the box is also not ideal.

The "filename template" seems to be the thing that would get complicated to do well. We'd definitely welcome your help and ideas.

@bonigarcia
Copy link
Member

is there an easy guide for what SM is looking for schema-wise? What's the minimal example for pointing to a browser/driver?

I don't understand these questions. What I can say about the mirrors in Selenium Manager is that they must reply in the same format as the original repositories.

@titusfortner
Copy link
Member Author

Yeah, a schema is just the json structure with types. So a minimum example would be how to find one browser/driver without failing for bad formatting.
Also, since the structure is the same, does it matter separating driver and browser mirrors? I guess maybe for Firefox and edge?

@bonigarcia
Copy link
Member

CfT shares browsers and drivers currently. But for old versions of chromedriver (115-), there were only drivers. And Firefox and Edge have different repositories (and expected responses) for browsers and drivers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants