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

[Windows Bug] Chromedriver verison problem #450

Open
yuxiaolejs opened this issue Oct 17, 2024 · 5 comments
Open

[Windows Bug] Chromedriver verison problem #450

yuxiaolejs opened this issue Oct 17, 2024 · 5 comments

Comments

@yuxiaolejs
Copy link

I have been working with GHOSTS for nearly two months, and recently the BrowserChrome handler stopped working on Windows machines. It used to work with the chromedriver shipped in the archive, but now I have to download a newer version of chromedriver and overwrite it manually. The error message produced using the stock chromedriver from the archive looks like this:

17/10/2024 6:48:21 AM|Error|Ghosts.Client.Handlers.BrowserChrome.ChromeEx|System.InvalidOperationException: session not created: This version of ChromeDriver only supports Chrome version 124
Current browser version is 130.0.6723.58 with binary path C:\Users\Administrator\.cache\selenium\chrome\win64\130.0.6723.58\chrome.exe (SessionNotCreated)
17/10/2024 6:48:25 AM|Error|Ghosts.Client.Handlers.BrowserChrome.ChromeEx|System.InvalidOperationException: session not created: This version of ChromeDriver only supports Chrome version 124
Current browser version is 130.0.6723.58 with binary path C:\Users\Administrator\.cache\selenium\chrome\win64\130.0.6723.58\chrome.exe (SessionNotCreated)

Please forgive me for running GHOSTS under Administrator. This is currently proof of concept, and I don't think this can be the cause of the problem.

FYI, the platform I'm running it on is an AWS EC2 instance (t3.small), with Windows Server 2022 21H2.

I'm very much interested in how the chrome/selenium packages are downloaded because I didn't see any explicit code related to that, is it provided by the OpenQA.Selenium package? It will be great if there's a way to pin both the version of chrome/selenium and chromedriver so that this version mismatch will not occur in production.

Any thoughts or suggestions are welcomed, and thanks in advance!

@yuxiaolejs
Copy link
Author

yuxiaolejs commented Oct 17, 2024

Additionally, as mentioned in #414 , the version of both Chromedriver and Chrome seemed to be consistent across updates, and it appears it always pulls the latest version of both, no matter the version of GHOSTS. Is it possible for the Windows version to have a similar feature? (Since I saw selenium-manager is shipped with binaries for both OS)

I checked the repo and didn't figure out where GHOSTS called the selenium-manager, I'm assuming it's an implicit call done by the selenium package. However, I was able to get latest chrome along with chromedriver downloaded using the new selenium-manage (v0.4.25) found here (mentioned here) instead of the one provided in the archive (v0.4.20) which gives an error when run with .\selenium-manager-windows.exe --driver chromedriver that

[2024-10-17T07:22:22.969Z DEBUG] Sending stats to Plausible: Props { browser: "chrome", browser_version: "", os: "windows", arch: "amd64", lang: "", selenium_version: "4.20" }
[2024-10-17T07:22:23.082Z DEBUG] chromedriver not found in PATH
[2024-10-17T07:22:23.397Z DEBUG] chrome not found in PATH
[2024-10-17T07:22:23.398Z DEBUG] Running command: REG QUERY HKCU\Software\Google\Chrome\BLBeacon /v version
[2024-10-17T07:22:23.478Z DEBUG] Output: ""
[2024-10-17T07:22:23.480Z DEBUG] chrome not found in the system
[2024-10-17T07:22:23.481Z DEBUG] Discovering versions from https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json
[2024-10-17T07:22:23.514Z DEBUG] Required browser: chrome 130.0.6723.58
[2024-10-17T07:22:23.547Z DEBUG] Downloading chrome 130.0.6723.58 from https://storage.googleapis.com/chrome-for-testing-public/130.0.6723.58/win64/chrome-win64.zip
[2024-10-17T07:22:23.706Z ERROR] The system cannot find the path specified. (os error 3) at path "C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\2\\selenium-managerdNeiR7"

I think this problem can be fixed by running the correct version of selenium manager and fetching the matching version of driver and browser.

@sei-dupdyke
Copy link
Contributor

Hi, thanks for the detail.

Currently the windows client is still on the traditional windows-only .net framework and references:

<PackageReference Include="Selenium.WebDriver">
      <Version>4.20.0</Version>
</PackageReference>
<PackageReference Include="Selenium.WebDriver.ChromeDriver">
      <Version>124.0.6367.9100</Version>
</PackageReference>
<PackageReference Include="Selenium.WebDriver.GeckoDriver">
      <Version>0.34.0</Version>
</PackageReference>

the linux version is using dotnetcore, now just dotnet (version 8) and so references different libraries.

It looks like the library you suggest fixes this issue - https://www.nuget.org/packages/WebDriverManager/

But requires some code changes. Since I have to maintain a windows vm for the windows client side, these changes take a bit longer, but i'll try to look at it this week or next.

@sei-dupdyke
Copy link
Contributor

Really though, I would love to move the windows client to dotnet 8 for ease of development purposes, and condensation of a great deal of code — but I'm not sure how this would affect the community.

@yuxiaolejs
Copy link
Author

@sei-dupdyke thank you for this fast reply! I am looking forward to that!

For now, I gonna continue with my workaround for now and I can provide more information here if it's stable.

@dh4340
Copy link
Contributor

dh4340 commented Oct 24, 2024

Really though, I would love to move the windows client to dotnet 8 for ease of development purposes, and condensation of a great deal of code — but I'm not sure how this would affect the community.

I would be so happy if you did, would modernise the whole project!

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

No branches or pull requests

3 participants