lib/selenium/webdriver/common/driver_finder.rb in selenium-webdriver-4.20.1 vs lib/selenium/webdriver/common/driver_finder.rb in selenium-webdriver-4.22.0

- old
+ new

@@ -57,10 +57,17 @@ else output = SeleniumManager.binary_paths(*to_args) formatted = {driver_path: Platform.cygwin_path(output['driver_path'], only_cygwin: true), browser_path: Platform.cygwin_path(output['browser_path'], only_cygwin: true)} Platform.assert_executable(formatted[:driver_path]) - Platform.assert_executable(formatted[:browser_path]) + + browser_path = formatted[:browser_path] + Platform.assert_executable(browser_path) + if @options.respond_to?(:binary) && @options.binary.nil? + @options.binary = browser_path + @options.browser_version = nil + end + formatted end rescue StandardError => e WebDriver.logger.error("Exception occurred: #{e.message}") WebDriver.logger.error("Backtrace:\n\t#{e.backtrace&.join("\n\t")}")