Closed davetron5000 closed 1 year ago
Downloading new versions is the primary purpose of this gem. Your monkey patch is pretty much just turning off the gem. I'd recommend not using this gem and setting the location of the driver in Selenium directly:
Selenium::WebDriver::Chrome::Service.driver_path = "/usr/bin/chromedriver"
As for linux arm64 support, electron provides a driver, and support for it was requested in #242. As I mentioned there, though, we're working to get things implemented in Selenium itself so all Selenium languages can benefit. (https://github.com/SeleniumHQ/selenium/issues/11357).
OK, that makes sense. Can confirm your solution works i.e. removing this gem and using that line of configuration. How did you know to do that? I have been over the Web driver docs and cannot where this is documented. I can find it in the source code, but would not have known what it was. If there aren't docs I'm happy to provide, but I'm not sure where they should go ( here? https://www.selenium.dev/documentation/webdriver/drivers/service/ )
I know to do that because I implemented the code in Selenium to better support this gem. 😄
The line of code is there at the bottom of the file so that it always executes just by requiring the gem. It's implemented with a proc so that the code only executes when Selenium goes to start that specific driver. It's a step up from the previous driver helper gems that used shims for storing drivers.
Building the driver support into selenium itself is going to be another big step up. It will manage both browser and driver version downloads and settings for everything will be parsed from the browser options class.
Summary
On Linux ARM64, webdrivers installs the X64 chromedriver which doesn't work. As there is no official ARM64 chromedriver (because there is no ARM64 chrome for linux), this leaves me in a pickle as to how to make this work.
One can get chromium-chromedriver for arm64, but this gem doesn't not provide a way to control what chromedriver executable is being used.
I'm posting this to 1) see if there is a way to fix this and 2) document how I was able to get it working via monkeypatching for others.
Debug Info
Please provide the following information for bug reports:
Expected Behavior
Either the gem uses the arm64 chromium and chromium-chromedriver or allows me to override its settings for chromedriver to use what i have installed.
Actual Behavior
With DEBUG logging:
Workaround
For me, chromium-chromedriver installs in
/usr/bin/chromedriver
, so this is what I did:It also works to set WD_INSTALL_DIR to
/usr/bin
(in my case), but you still need to keep it from trying to update thereI'm glad I can make it work, but I don't actually want webdrivers to install anything. I just need it to bridge the rails system tests and chromium installation by using what I have already set up, so something like:
would be great.
Edit to clarify
correct_binary?
and preventing downloading new versions