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]: Selenium Manager support more architectures #11357

Closed
titusfortner opened this issue Dec 3, 2022 · 30 comments
Closed

[🚀 Feature]: Selenium Manager support more architectures #11357

titusfortner opened this issue Dec 3, 2022 · 30 comments

Comments

@titusfortner
Copy link
Member

titusfortner commented Dec 3, 2022

Feature and motivation

Quick check of what architectures are supported by each driver...
Which of these should we support?
Do we need to wait until we can get rust and/or bazel to cross compile?
It looks like cross-compilation with cross might be straightforward - https://kerkour.com/rust-cross-compilation

Architecture chromedriver edgedriver geckodriver
mac64 ✅ 10%
linux64 ✅ 48%
win32 ✅ 5%
mac-arm64 ✅ 10%
linux-arm64 🔲 2%
linux-32 🔲 1%
win-arm64 ✅ 2%
win64 ✅ 28%
@github-actions
Copy link

github-actions bot commented Dec 3, 2022

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

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!

@titusfortner
Copy link
Member Author

Well, played around a bit, and I could do:
https://github.com/titusfortner/selenium/actions/runs/3609798451

Note this builds x86_64-pc-windows-gnu but not x86_64-pc-windows-msvc

per the cross repo:

Additional Dockerfiles for other targets can be found in cross-toolchains. These include MSVC and Apple Darwin targets, which we cannot ship pre-built images of.

I could not figure out how to get those working, though; someone who knows more about docker than how to spell it might get further.

@ollie-iterators
Copy link

Is this related to the process of consolidating Selenium and Appium by making sure that Selenium can support the same architecture as Appium?

@titusfortner
Copy link
Member Author

No, this is just making sure that people using Selenium on these architectures are automatically obtaining the correct drivers if publicly available.

@titusfortner
Copy link
Member Author

@bonigarcia so this is essentially a rust question. Which of the drivers that get published is Selenium Manager looking for based on architecture? (e.g. does it always get win32 driver instead of the win64 geckodriver or edgedriver?)

I'm trying to figure out the different scenarios and what kinds of errors.

What driver does S/M return when:

  1. Chrome on win-arm64
  2. Edge on win-arm64

Are there combinations where nothing is obtained and an error is thrown? What is that error?
Are there unit tests for these scenarios?

@p0deje
Copy link
Member

p0deje commented Apr 21, 2023

I'm playing around with Windows ARM and prebuilt SM downloads win32 for Chrome and win64 for Edge/Firefox:

PS C:\selenium> .\common\manager\windows\selenium-manager.exe --browser chrome --debug
DEBUG   Using shell command to find out chrome version
DEBUG   Running command: "wmic datafile where name='%PROGRAMFILES:\\=\\\\%\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe' get Version /value"
DEBUG   Output: "\r\r\n\r\r\nVersion=112.0.5615.138\r\r\n\r\r\n\r\r\n\r"
DEBUG   The version of chrome is 112.0.5615.138
DEBUG   Detected browser: chrome 112
DEBUG   Required driver: chromedriver 112.0.5615.49
DEBUG   Running command: "chromedriver --version"
DEBUG   Output: "ChromeDriver 108.0.5359.71 (1e0e3868ee06e91ad636a874420e3ca3ae3756ac-refs/branch-heads/5359@{#1016})"
DEBUG   Running command: "where chromedriver"
DEBUG   Output: "C:\\ProgramData\\chocolatey\\bin\\chromedriver.exe"
WARN    Incompatible release of chromedriver (version 108.0.5359.71) detected in PATH: C:\ProgramData\chocolatey\bin\chromedriver.exe
DEBUG   chromedriver 112.0.5615.49 already in the cache
INFO    C:\Users\alex\.cache\selenium\chromedriver\win32\112.0.5615.49\chromedriver.exe
PS C:\selenium> .\common\manager\windows\selenium-manager.exe --browser firefox --debug
DEBUG   Using shell command to find out firefox version
DEBUG   Running command: "wmic datafile where name='%PROGRAMFILES:\\=\\\\%\\\\Mozilla Firefox\\\\firefox.exe' get Version /value"
DEBUG   Output: "\r\r\n\r\r\nVersion=111.0.1.8480\r\r\n\r\r\n\r\r\n\r"
DEBUG   The version of firefox is 111.0.1.8480
DEBUG   Detected browser: firefox 111
DEBUG   Required driver: geckodriver 0.33.0
DEBUG   Running command: "geckodriver --version"
DEBUG   Output: ""
DEBUG   Driver URL: https://github.com/mozilla/geckodriver/releases/download/v0.33.0/geckodriver-v0.33.0-win64.zip
DEBUG   File extracted to C:\Users\alex\.cache\selenium\geckodriver\win64\0.33.0\geckodriver.exe (3884960 bytes)
INFO    C:\Users\alex\.cache\selenium\geckodriver\win64\0.33.0\geckodriver.exe
PS C:\selenium> .\common\manager\windows\selenium-manager.exe --browser edge --debug
DEBUG   Using shell command to find out edge version
DEBUG   Running command: "wmic datafile where name='%PROGRAMFILES(X86):\\=\\\\%\\\\Microsoft\\\\Edge\\\\Application\\\\msedge.exe' get Version /value"
DEBUG   Output: "\r\r\n\r\r\nVersion=112.0.1722.48\r\r\n\r\r\n\r\r\n\r"
DEBUG   The version of edge is 112.0.1722.48
DEBUG   Detected browser: edge 112
DEBUG   Required driver: msedgedriver 112.0.1722.48
DEBUG   Running command: "msedgedriver --version"
DEBUG   Output: ""
DEBUG   Driver URL: https://msedgedriver.azureedge.net/112.0.1722.48/edgedriver_win64.zip
DEBUG   File extracted to C:\Users\alex\.cache\selenium\msedgedriver\win64\112.0.1722.48\msedgedriver.exe (17087912 bytes)
INFO    C:\Users\alex\.cache\selenium\msedgedriver\win64\112.0.1722.48\msedgedriver.exe

@titusfortner
Copy link
Member Author

So we should be getting the win-arm64 versions of msedgedriver and geckodriver.
Should we be erroring for Chrome since there isn't a win-arm64 version? Or should we let the driver see what it can do?

@p0deje
Copy link
Member

p0deje commented Apr 22, 2023

So we should be getting the win-arm64 versions of msedgedriver and geckodriver.

Yes, we should

Should we be erroring for Chrome since there isn't a win-arm64 version? Or should we let the driver see what it can do?

I guess the current behavior is fine as long ChromeDriver works.

@titusfortner
Copy link
Member Author

Do we know if it does? I'm kind of curious why Google doesn't release a separate binary, or what might not work. I guess all we can do is give the best option available and figure it out from there.

@p0deje
Copy link
Member

p0deje commented Apr 22, 2023

I suppose it works given Ruby tests for Chrome pass on my Windows VM.

@bonigarcia
Copy link
Member

Regarding chromedriver, it is ok that Selenium Manager in Windows always downloads the x32 architecture since that's the only one published by the chromedriver team.

Regarding geckodriver and msedgedriver in Windows, Selenium Manager in Windows currently only supports x32 and x64 architectures. I can prepare a patch to support ARM64 for those Windows drivers (although I don't have an ARM64 machine to test with).

@bonigarcia
Copy link
Member

@p0deje Can you run the following command in your Windows ARM64 and tell me the output, please?

wmic os get osarchitecture

@p0deje
Copy link
Member

p0deje commented Apr 24, 2023

@bonigarcia There you go, I can test this as soon as you have a new version (I can also build manager now)!

C:\selenium>wmic os get osarchitecture
OSArchitecture
ARM 64-bit Processor

@bonigarcia
Copy link
Member

Thanks @p0deje.

I have just committed a patch to enable the detection of ARM in Windows (branch se_mgr_winarm). You can get the resulting binary using that branch from here:

https://github.com/SeleniumHQ/selenium/actions/runs/4787671731

@titusfortner
Copy link
Member Author

titusfortner commented Apr 24, 2023

I updated the original post. Green checkmarks are the ones I'm pretty sure that Selenium Manager downloads right now. Red X's aren't supported by the driver. The empty boxes are the ones that have a driver, but I don't know if SM will grab them.

@bonigarcia can you verify which drivers can be downloaded right now based on architectures we are parsing? Thanks!

@p0deje
Copy link
Member

p0deje commented Apr 24, 2023

@bonigarcia It works great!

C:\Users\alex\Downloads>selenium-manager.exe --browser edge   
INFO    C:\Users\alex\.cache\selenium\msedgedriver\win-arm64\112.0.1722.58\msedgedriver.exe

C:\Users\alex\Downloads>selenium-manager.exe --browser firefox
INFO    C:\Users\alex\.cache\selenium\geckodriver\win-arm64\0.33.0\geckodriver.exe

@bonigarcia
Copy link
Member

@titusfortner The empty boxes on win64 should be green. Also, with the latest patch (branch se_mgr_winarm), the empty boxes on win-arm64 should be green as well.

@titusfortner
Copy link
Member Author

So it's just the geckodriver, linux 32 & Linux ARM that aren't getting used?

@bonigarcia
Copy link
Member

So it's just the geckodriver, linux 32 & Linux ARM that aren't getting used?

That's right.

@titusfortner
Copy link
Member Author

titusfortner commented Apr 24, 2023

Are those easy to toggle for/add? Would love to close this issue and not think/worry about architectures any more. 😂

@bonigarcia
Copy link
Member

bonigarcia commented Apr 24, 2023

Are those easy to toggle for/add?

I think these drivers would be supported if these Selenium Manager binaries (i.e. Linux 32 and Linux ARM64) would be generated.

@titusfortner
Copy link
Member Author

Can we cross compile Linux 32 bit on the 64bit container? I think(?) it might work for all Linux implementations similar to what we do for windows?

@bonigarcia
Copy link
Member

Can we cross compile Linux 32 bit on the 64bit container?

I didn't try, but I suppose it is possible.

I think(?) it might work for all Linux implementations similar to what we do for windows?

I'm not sure about that, perhaps it is possible, like in Windows, but I didn't try.

@bonigarcia
Copy link
Member

Do we plan to support any other architecture (e.g. Linux ARM) at this moment? If not, can we close this issue?

@titusfortner
Copy link
Member Author

Does win-arm64 work for Edge & Firefox?

The ones that aren't supported are Linux 32 bit & Linux ARM, and yeah, I think we're ok ignoring those for now.

@bonigarcia
Copy link
Member

Does win-arm64 work for Edge & Firefox?

I don't understand this question

@titusfortner
Copy link
Member Author

titusfortner commented Aug 3, 2023

@p0deje did you say that the windows binary we have works for you on your M1 in Windows VM?
(and does it properly get the arm versions of Edge & Firefox drivers?)

@p0deje
Copy link
Member

p0deje commented Aug 3, 2023

@titusfortner yes, it works fine #11357 (comment)

@titusfortner
Copy link
Member Author

So, yeah. we support 100% of chrome & edge drivers & 97% of geckodriver downloads. We can close.
🎉 🚀

Copy link

github-actions bot commented Dec 9, 2023

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 Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Done
Development

No branches or pull requests

4 participants