selenium: [πŸ› Bug]: Could not run selenium manager on Mac within Java

What happened?

I tried to update my framework based on Selenium 4.0.0 up to 4.9.1 but I am not able to download any driver automatically. I always get this error:

org.openqa.selenium.manager.SeleniumManager getDriverPath INFO: Applicable driver not found; attempting to install with Selenium Manager (Beta) org.openqa.selenium.manager.SeleniumManager runCommand WARNING: IOException running command [/var/folders/w5/v_wd9tx15yq470sv3l7xk1sw0000gn/T/selenium-manager203730314819166584070647341325405/selenium-manager, --browser, chrome, --output, json]: Cannot run program β€œ/var/folders/w5/v_wd9tx15yq470sv3l7xk1sw0000gn/T/selenium-manager203730314819166584070647341325405/selenium-manager”: error=86, Bad CPU type in executable KvΔ› 18, 2023 2:15:30 ODP. org.openqa.selenium.remote.service.DriverFinder getPath WARNING: Unable to obtain chromedriver using Selenium Manager: Unable to parse:

java.lang.IllegalStateException: The path to the driver executable Unable to locate the chromedriver executable; for more information on how to install drivers, see https://www.selenium.dev/documentation/webdriver/getting_started/install_drivers/

CPU

Apple M1 Pro

Java

openjdk version β€œ1.8.0_362” OpenJDK Runtime Environment (Zulu 8.68.0.21-CA-macos-aarch64) (build 1.8.0_362-b09) OpenJDK 64-Bit Server VM (Zulu 8.68.0.21-CA-macos-aarch64) (build 25.362-b09, mixed mode)

Maven

Apache Maven 3.9.2

How can we reproduce the issue?

WebDriver driver =  new ChromeDriver();

Relevant log output

org.openqa.selenium.manager.SeleniumManager getDriverPath
INFO: Applicable driver not found; attempting to install with Selenium Manager (Beta)
org.openqa.selenium.manager.SeleniumManager runCommand
WARNING: IOException running command [/var/folders/w5/v_wd9tx15yq470sv3l7xk1sw0000gn/T/selenium-manager203730314819166584070647341325405/selenium-manager, --browser, chrome, --output, json]: Cannot run program "/var/folders/w5/v_wd9tx15yq470sv3l7xk1sw0000gn/T/selenium-manager203730314819166584070647341325405/selenium-manager": error=86, Bad CPU type in executable
KvΔ› 18, 2023 2:15:30 ODP. org.openqa.selenium.remote.service.DriverFinder getPath
WARNING: Unable to obtain chromedriver using Selenium Manager: Unable to parse: 

java.lang.IllegalStateException: The path to the driver executable Unable to locate the chromedriver executable; for more information on how to install drivers, see https://www.selenium.dev/documentation/webdriver/getting_started/install_drivers/

Operating System

macOS Ventura 13.3.1

Selenium version

4.9.1

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

Chrome

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

113.0.5672.126

Are you using Selenium Grid?

No

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 30 (16 by maintainers)

Most upvoted comments

I tried to remove the logger and delete .cache/selenium, selenium manager still working well. So I was thinking about what else may be different and I find out that I have installed WhatsApp which is running in Rosetta 2 so it might be the trigger of Rosetta in general.

So I think the command /usr/sbin/softwareupdate -install-rosetta -agree-to-license does not work until you run at least one app which is running under Rosetta 2.