'M1 Selenium Server Can't find Chromedriver?

I am running Selenium on a background process, with Chrome headless mode. I was installing the Selenium and chromedriver as:

brew install --cask chromedriver
brew install selenium-server

And it is a mac mini M1.

I have checked the logs of Selenium-server. It keeps cannot find the chromedriver.

I have run the same config on a older macbook air (non-M1), which run completely fine.

And my code are nodejs. But I am pretty sure it do nothing with nodejs, and it is a selenium-server detecting chromedriver problem.

Below is the log:

00:26:33.369 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
00:26:33.371 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
00:26:33.795 INFO [NodeOptions.getSessionFactories] - Detected 8 available processors
00:26:33.807 INFO [NodeOptions.discoverDrivers] - Discovered 1 driver(s)
00:26:33.815 INFO [NodeOptions.report] - Adding Safari for {"browserName": "safari"} 1 times
00:26:33.828 INFO [Node.<init>] - Binding additional locator mechanisms: name, id, relative
...
00:26:33.894 INFO [Standalone.execute] - Started Selenium Standalone 4.1.2 (revision 9a5a329c5a): http://10.0.1.14:4444

Please let me know how to fix this. Or any method that I can run a background automated selenium process on a mac mini M1. Thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source