SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
29.73k stars 8.02k forks source link

[🐛 Bug]: Selenium manager with --browser-path parameter downloads browser any way #14156

Closed vlad8x8 closed 1 week ago

vlad8x8 commented 1 week ago

What happened?

Selenium manager with --browser-path parameter downloads browser any way

How can we reproduce the issue?

selenium-manager.exe --browser-path "C:\Program Files\WindowsApps\MSTeams_24137.2216.2931.2440_x64__8wekyb3d8bbwe\ms-teams.exe" --browser "MicrosoftEdge" --browser-version 126

Expected: only edgedriver v126 downloaded, used existing browser from browser-path

Actual: edge browser downloaded, but not installed because already exists

Note: if I need --browser-version 126, then the process failed because can't install v125 ontop of existed v126

Relevant log output

selenium-manager.exe --browser-path "C:\Program Files\WindowsApps\MSTeams_24137.2216.2931.2440_x64__8wekyb3d8bbwe\ms-teams.exe" --browser "MicrosoftEdge" --browser-version 126 --trace
[2024-06-19T20:24:22.231Z TRACE] Reading metadata from C:\Users\vvelichko\.cache\selenium\se-metadata.json
[2024-06-19T20:24:22.235Z TRACE] Metadata file does not exist. Creating a new one
[2024-06-19T20:24:22.235Z DEBUG] Sending stats to Plausible: Props { browser: "microsoftedge", browser_version: "126", os: "windows", arch: "amd64", lang: "", selenium_version: "4.21" }
[2024-06-19T20:24:22.235Z TRACE] Writing metadata to C:\Users\vvelichko\.cache\selenium\se-metadata.json
[2024-06-19T20:24:22.235Z TRACE] Checking msedgedriver in PATH
[2024-06-19T20:24:22.245Z DEBUG] msedgedriver not found in PATH
[2024-06-19T20:24:22.246Z TRACE] Path C:\Program Files\WindowsApps\MSTeams_24137.2216.2931.2440_x64__8wekyb3d8bbwe\ms-teams.exe has been escaped to C:\\Program Files\\WindowsApps\\MSTeams_24137.2216.2931.2440_x64__8wekyb3d8bbwe\\ms-teams.exe
[2024-06-19T20:24:22.246Z TRACE] Using shell command to find out MicrosoftEdge version
[2024-06-19T20:24:22.246Z DEBUG] Running command: wmic datafile where name='C:\\Program Files\\WindowsApps\\MSTeams_24137.2216.2931.2440_x64__8wekyb3d8bbwe\\ms-teams.exe' get Version /value
[2024-06-19T20:24:22.324Z DEBUG] Output: "\r\r\n\r\r\nVersion=24137.2216.2931.2440\r\r\n\r\r\n\r\r\n\r"
[2024-06-19T20:24:22.325Z TRACE] The version of MicrosoftEdge is 24137.2216.2931.2440
[2024-06-19T20:24:22.326Z DEBUG] Detected browser: MicrosoftEdge 24137.2216.2931.2440
[2024-06-19T20:24:22.326Z DEBUG] Discovered MicrosoftEdge version (24137) different to specified browser version (126)
[2024-06-19T20:24:22.326Z TRACE] Reading metadata from C:\Users\vvelichko\.cache\selenium\se-metadata.json
[2024-06-19T20:24:22.327Z DEBUG] Checking MicrosoftEdge releases on https://edgeupdates.microsoft.com/api/products/?view=enterprise
[2024-06-19T20:24:22.886Z TRACE] Products: [EdgeProduct { product: "Stable", releases: [Release { release_id: 76094, platform: "Linux", architecture: "x64", cves: [], product_version: "126.0.2592.61", artifacts: [Artifact { artifact_name: ......
[2024-06-19T20:24:22.909Z TRACE] Releases: [Release { release_id: 76139, platform: "Windows", architecture: "x64", cves: [], product_version: "126.0.2592.61", artifacts: [Artifact { artifact_name: "msi", location: "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/a71e77fb-bd87-4015-9063-d9cd752fd708/MicrosoftEdgeEnterpriseX64.msi", hash: "6AA033BFE68BB9428F963A35BA5FE85035F480F2FE647C8A660961EA6D849D29", hash_algorithm: "SHA256", size_in_bytes: 178827264 }], published_time: "2024-06-17T20:49:00", expected_expiry_date: "2025-06-17T20:49:00" }, Release { release_id: 75918, platform: "Windows", architecture: "x64", cves: ["CVE-2024-30055", "CVE-2024-30057", "CVE-2024-30058", "CVE-2024-30056", "CVE-2024-4331", "CVE-2024-4559", "CVE-2024-5159", "CVE-2024-5843", "CVE-2024-5840", "CVE-2024-4671", "CVE-2024-5157", "CVE-2024-5839", "CVE-2024-5493", "CVE-2024-5499", "CVE-2024-5836", "CVE-2024-5497", "CVE-2024-5496"], product_version: "126.0.2592.56", artifacts: [Artifact { artifact_name: "msi", location: "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/3bbec756-02a0-4bf2-a403-e59c89eee4ae/MicrosoftEdgeEnterpriseX64.msi", hash: "D2ECDEB8650AB7E60441881B022E692DC59603865A78070BDF1745B27C9BD111", hash_algorithm: "SHA256", size_in_bytes: 178946048 }], published_time: "2024-06-13T19:28:00", expected_expiry_date: "2025-06-13T19:28:00" }]
[2024-06-19T20:24:22.909Z TRACE] Artifacts: [Artifact { artifact_name: "msi", location: "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/a71e77fb-bd87-4015-9063-d9cd752fd708/MicrosoftEdgeEnterpriseX64.msi", hash: "6AA033BFE68BB9428F963A35BA5FE85035F480F2FE647C8A660961EA6D849D29", hash_algorithm: "SHA256", size_in_bytes: 178827264 }]
[2024-06-19T20:24:22.910Z TRACE] Writing metadata to C:\Users\vvelichko\.cache\selenium\se-metadata.json
[2024-06-19T20:24:22.910Z DEBUG] Required browser: MicrosoftEdge 126.0.2592.61
[2024-06-19T20:24:22.911Z DEBUG] MicrosoftEdge 126.0.2592.61 already exists
[2024-06-19T20:24:22.911Z DEBUG] MicrosoftEdge 126.0.2592.61 is available at C:\Program Files (x86)\Microsoft\Edge\Application\126.0.2592.61\msedge.exe
[2024-06-19T20:24:22.911Z TRACE] Reading metadata from C:\Users\vvelichko\.cache\selenium\se-metadata.json
[2024-06-19T20:24:22.912Z DEBUG] Reading msedgedriver version from https://msedgedriver.azureedge.net/LATEST_RELEASE_126_WINDOWS
[2024-06-19T20:24:23.203Z TRACE] Writing metadata to C:\Users\vvelichko\.cache\selenium\se-metadata.json
[2024-06-19T20:24:23.204Z DEBUG] Required driver: msedgedriver 126.0.2592.61
[2024-06-19T20:24:23.205Z DEBUG] Downloading msedgedriver 126.0.2592.61 from https://msedgedriver.azureedge.net/126.0.2592.61/edgedriver_win64.zip
[2024-06-19T20:24:23.208Z TRACE] Downloading https://msedgedriver.azureedge.net/126.0.2592.61/edgedriver_win64.zip to temporal folder "C:\\Users\\VVELIC~1\\AppData\\Local\\Temp\\selenium-manager4yjkf9"
[2024-06-19T20:24:23.428Z TRACE] File to be downloaded: edgedriver_win64.zip
[2024-06-19T20:24:23.429Z TRACE] File downloaded to temporal folder: C:\Users\VVELIC~1\AppData\Local\Temp\selenium-manager4yjkf9\edgedriver_win64.zip
[2024-06-19T20:24:36.010Z TRACE] The detected extension of the compressed file is zip
[2024-06-19T20:24:36.010Z TRACE] Unzipping C:\Users\VVELIC~1\AppData\Local\Temp\selenium-manager4yjkf9\edgedriver_win64.zip to C:\Users\vvelichko\.cache\selenium\msedgedriver\win64\126.0.2592.61
[2024-06-19T20:24:36.012Z TRACE] File extracted to C:\Users\VVELIC~1\AppData\Local\Temp\selenium-manager4yjkf9
[2024-06-19T20:24:36.037Z TRACE] File extracted to C:\Users\VVELIC~1\AppData\Local\Temp\selenium-manager4yjkf9\credits.html (9615439 bytes)
[2024-06-19T20:24:36.039Z TRACE] File extracted to C:\Users\VVELIC~1\AppData\Local\Temp\selenium-manager4yjkf9\EULA (10998 bytes)
[2024-06-19T20:24:36.042Z TRACE] File extracted to C:\Users\VVELIC~1\AppData\Local\Temp\selenium-manager4yjkf9\LICENSE (423000 bytes)
[2024-06-19T20:24:36.155Z TRACE] File extracted to C:\Users\VVELIC~1\AppData\Local\Temp\selenium-manager4yjkf9\msedgedriver.exe (17680448 bytes)
[2024-06-19T20:24:36.157Z TRACE] Copying C:\Users\VVELIC~1\AppData\Local\Temp\selenium-manager4yjkf9\msedgedriver.exe to C:\Users\vvelichko\.cache\selenium\msedgedriver\win64\126.0.2592.61\msedgedriver.exe
[2024-06-19T20:24:36.169Z INFO ] Driver path: C:\Users\vvelichko\.cache\selenium\msedgedriver\win64\126.0.2592.61\msedgedriver.exe
[2024-06-19T20:24:36.169Z INFO ] Browser path: C:\Program Files (x86)\Microsoft\Edge\Application\126.0.2592.61\msedge.exe

Operating System

Windows 10

Selenium version

Java 4.21.0

What are the browser(s) and version(s) where you see this issue?

MS Teams

What are the browser driver(s) and version(s) where you see this issue?

msedgedriver 126.0.2592.61

Are you using Selenium Grid?

No response

github-actions[bot] commented 1 week ago

@vlad8x8, 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!

diemol commented 1 week ago

Why do you need to provide the path and the version?

vlad8x8 commented 1 week ago

to make selenium manager download needed edge driver also, without version it's failing selenium-manager.exe --browser-path "C:\Program Files\WindowsApps\MSTeams_24137.2216.2931.2440_x64__8wekyb3d8bbwe\ms-teams.exe" --browser "MicrosoftEdge" [2024-06-19T20:50:42.754Z ERROR] Wrong browser/driver version

titusfortner commented 1 week ago

Duplicate #13352

titusfortner commented 1 week ago

Oops, meant to link this one - https://github.com/SeleniumHQ/selenium/issues/13418