-
Notifications
You must be signed in to change notification settings - Fork 111
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
Google Chrome on Apple M1 architecture #191
Comments
Hmm... I don't have a M1 mac to reproduce this and I am not seeing any new, specific Might be better to create this issue in the chromium issue tracker. |
Thank you for looking at this! I found a M1 version of chromedriver here (darwin-arm64.zip): https://github.com/electron/electron/releases I was able to test it, it started the correct Chrome and... holy cow, that was fast! My (parallel) test suite went from 2min20 to 1min30. And only 140 of my 900 specs use the browser. I knew they were the slowest specs but still, that was unexpected. For reference, my high-end 2018 i7 MacBook ran the specs in 2min30. Apple is not kidding with this new CPU. I have a naïve question: would it be possible to compile chromedriver directly with this gem? Either way, I will open an issue on Chromium to ask for an ARM64 version. Have a great New Year! |
Nice! I am not seeing the
Wow that's really good.
Nope. The gem simply reaches out to the download servers and fetches the binary matching your browser version. I'll keep this issue open until we have implemented support for the M1 specific chromedriver. |
I also had success getting Chrome invoked natively ( However, unlike the original x86 one installed, for some reason this build was not able to find my Google Chrome application binary:
I was able to fix this by manually specifying the binary path on my machine with something like this, in the context of capybara / selenium webdriver (where Capybara.register_driver :headless_chrome do |app|
client = Selenium::WebDriver::Remote::Http::Default.new
client.read_timeout = 240
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
chromeOptions: {
args: %w(headless disable-gpu window-size=1440,900),
prefs: chrome_preferences,
w3c: false,
binary: ENV["SELENIUM_CHROME_BINARY_PATH"]
}
)
Capybara::Selenium::Driver.new(app,
browser: :chrome,
desired_capabilities: capabilities,
http_client: client
)
end For me, capybara feature specs are running about 20% faster under native arm64 Chrome / chromedriver. |
I opened an issue on the Chromium bugtracker: https://bugs.chromium.org/p/chromium/issues/detail?id=1162906 Feel free to upvote it to increase the chances someone sees it (62361 opened issues 😄 ).
I had the same issue with the path to Chrome, maybe Electron built the binary with another default path? Selenium::WebDriver::Chrome.path = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
I have noticed that in my case, the improvements were way better using multi-core than single-core. Are you already using something like https://github.com/grosser/parallel_tests ?
Thank you! It's really appreciated! 👍 |
I just found out that ChromeDriver uses a separate bugtracker, and a similar ticket is already open: https://bugs.chromium.org/p/chromedriver/issues/detail?id=3688
🎉 |
@MichaelHoste That's good to know. I have left a comment in that ticket. Thanks! |
I just opened a pull request to be able to download the correct chromedriver for your Mac from the official storage (like this one: https://chromedriver.storage.googleapis.com/index.html?path=87.0.4280.88/). Apparently, with the official M1 chromedriver version, it's not anymore needed to define the Google Chrome path manually like described by @rubiety or myself. It just works! 🍾 |
* Add support for Apple M1 architecture (chromedriver). Fixes #191 * Code Improvements
Thanks a lot Michael for fixing that! 🎉 In case someone ends up here trying to switch their |
Hi. I don't know if I'm doing anything wrong but chromedriver appears in Activity Monitor as Intel and not Apple (also the logs are saying so). I removed everything in Debug Info Webdrivers version: 4.6.1 Debug Output
Thanks for any help. |
Maybe I'm not at the right place to submit this issue. Feel free to close and redirect me.
I have a new Macbook M1, and I installed the M1-specific Google Chrome on my system to avoid using the Rosetta emulation. It works well!
However, when I'm running my test suite, I can see in the Activity Monitor that the headless Chrome is not started with the correct architecture. We can see "Intel" instead of "Apple":
I checked and Google Chrome seems to use Universal Binary, so either Intel or Apple, but the wrong one is started.
Would it be because chromedriver doesn't officially support M1 architecture? [1] And Google Chrome is forced to follow the same architecture?
Is there any way to fix this situation in webdrivers, and force Google Chrome with M1 architecture? It will certainly speed up significantly my test suite.
Or maybe I need to wait when (if?) a M1-specific chromedriver is released?
Any thoughts on this would be welcome 😄
[1] https://chromedriver.storage.googleapis.com/index.html?path=87.0.4280.88/
The text was updated successfully, but these errors were encountered: