SeleniumHQ / selenium

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

[🐛 Bug]: Selenium Manager should error if browser-path is wrong #13352

Open titusfortner opened 8 months ago

titusfortner commented 8 months ago

What happened?

I used an incorrect browser-path & it ignored it and downloaded a new version.

How can we reproduce the issue?

opts = Selenium::WebDriver::Options.firefox(binary: '/bad/path')
driver = Selenium::WebDriver.for :firefox, options: opts

Relevant log output

2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] Executing Process ["/Users/titusfortner/.rbenv/versions/3.0.6/lib/ruby/gems/3.0.0/gems/selenium-webdriver-4.16.0/bin/macos/selenium-manager", "--browser", "firefox", "--browser-path", "/bad/path", "--output", "json", "--debug"] 
2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] geckodriver not found in PATH 
2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] Running command: /bad/path -v 
2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] Output: "" 
2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] Running command: "/bad/path" -v 
2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] Output: "" 
2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] Running command: '/bad/path' -v 
2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] Output: "" 
2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] Running command: /bad/path -v 
2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] Output: "" 
2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] firefox not found in the system 
2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] Required browser: firefox 121.0 
2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] firefox 121.0 already exists 
2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] firefox 121.0 is available at /Users/titusfortner/.cache/selenium/firefox/mac64/121.0/Firefox.app/Contents/MacOS/firefox 
2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] Required driver: geckodriver 0.33.0 
2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] geckodriver 0.33.0 already in the cache 
2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] Driver path: /Users/titusfortner/.cache/selenium/geckodriver/mac64/0.33.0/geckodriver 
2023-12-21 18:35:08 DEBUG Selenium [:selenium_manager] Browser path: /Users/titusfortner/.cache/selenium/firefox/mac64/121.0/Firefox.app/Contents/MacOS/firefox 
2023-12-21 18:35:08 DEBUG Selenium [:driver_service] Executing Process ["/Users/titusfortner

Operating System

Mac

Selenium version

trunk

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

n/a

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

n/a

Are you using Selenium Grid?

n/a

vlad8x8 commented 2 months ago

Hi @titusfortner what browser path you are going to define as wrong?

titusfortner commented 2 months ago

Sorry, I linked the wrong issue, but they are related. If a user provides some combination of name/version/path and they are not compatible, it should error instead of trying to guess what to use.