-
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
Can't find Chrome Binary in WSL2 with version 4.4.2 #192
Comments
Was this working in v4.4.1? And please share the debug logs (instructions). I'll try to setup WSL2 tomorrow and reproduce this. @G-Rath Would it be possible for you to troubleshoot this as well? |
@kapoorlakshya I don't have WSLv2 setup, but happy to help where I can - I'll see if I can find some time to try get it setup somewhere so I can test things locally. |
@G-Rath Thanks! Here's what I've found: v4.4.1 and v4.4.2 are able to find the Chrome binary installed on my local system when using WSL2:
Side note: Need to look into the But I do get the
@fabioxgn Can you please follow the steps from the first code block and share what you're seeing? Chrome installed on my local machine is being found within WSL2, and Also do note that this gem currently only supports WSL1. This ticket might become the motivator to add WSL2 support soon, if there is a breaking change between the two at all. Need to look into that. |
That'll be because you've not got the new powershell installed, which we attempt to use if possible to avoid messing up the terminal due to an unfixable "bug" in conhost/powershell. I feel like this is what'll happen in WSL1 too.
That path doesn't look right to me? This is all just based on your comment (i.e. I've not done anything in WSL2) so it might be fine, but I'd try navigating to that path in Windows Explorer to see if you can actually get there. |
Right. Sorry, I should have been more clear - I meant that we should not be printing that harmless error in the console. It may confuse users using PS < 6.0 into thinking that something went wrong even though that error is successfully rescued. I was able to fix that when using PS 5.1 by redirecting
I looked into this and the apparently
So... I think my WSL setup is broken because I am unable to access the base path |
I was able to quickly fix my WSL setup and I am now able to access |
Just realized we actually don't need Powershell for this. |
@kapoorlakshya here's the output of the commands you asked, looks like to be ok, maybe this is some problem with my project's config that can't find chrome? |
Here's the debug output:
|
@fabioxgn Thanks for the logs. I am little confused why the Chrome path in the first comment is I'll try to fix it this week. |
@kapoorlakshya these logs are from the same run. I did not customize the Setting the
Guessing by the: |
@kapoorlakshya I did some more tests, and the powershell errors were because I didn't have powershell 7.1, I installed that and installed chrome on Windows but this still doesn't work:
|
But in any case, even fixing the powershell it is now impossible to use chrome on linux when using WSL, because it now correctly detects that it is running on WSL, it defaults to the windows version of chrome and tries to run chrome using powershell, even if you set the
My suggestion is to provide a flag to disable this wsl detection, so it can run the linux version of chrome. changing the |
@fabioxgn Thanks again for all the details and the PR! You are right that Powershell is incorrectly being used to retrieve the version from the Chrome binary on the Linux filesystem, which not only leads to Another approach besides adding the |
I don't know if what I did in my PR is the best solution, I think it would be best not to add a new config. I'll try some ideas to see if there's a better solution. |
@kapoorlakshya I did some more testing and I think we should revert this change: https://github.com/titusfortner/webdrivers/pull/187/files It doesn't work on WSLv2 and I don't think it was tested on it. WSL2 networking is different from WSL1 and you can't connect from the WSL2 Linux on chromedriver running on Windows using So with this changed now it detects that is running on WSL but Selenium can't connect to the chromedriver, so this just doesn't work on WSL2. Maybe we can revert this and make it more explicity changing the |
uses information from (https://askubuntu.com/questions/1177729/wsl-am-i-running-version-1-or-version-2) checking if the WSL kernel version is < 4.19 then it is WSL 1
After updating to v4.4.2 my tests are failing with:
I've tried to set the
WD_CHROME_PATH
to the chrome binary path of my WSL2 Ubuntu installation but it doesn't work either:What's the proper way to use chrome on WSL2?
The text was updated successfully, but these errors were encountered: