-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Description
Description
Selenium Manager cannot pull the correct image if running from Linux based container on macOS host.
The host is a MacBook Pro with macOS running on Apple Silicon (M2). A Docker container was created from a custom Docker image based on the Alpine Linux base image (aarch64) with all required packages like openjdk, chromium-chromedriver, maven, etc., installed.
Dockerfile:
FROM alpine:3.22.2
RUN apk update \
&& apk upgrade \
&& apk --no-cache add chromium-chromedriver maven openjdk21
WORKDIR /project
ENTRYPOINT ["mvn"]
The local repo with tests is attached to the container via the "docker run -v" command, so the tests are started through the "mvn clean test" command and technically running in the Linux container environment. The host just initiated the whole process via the docker run command. There are no Selenium Grid or Remote WebDriver in this workflow. Prior to 4.37.0 with this adjustment, everything worked fine.
Reproducible Code
docker run --name sample --pull missing -v /Users/xxxxx/IdeaProjects/playground:/project sample:1.0 clean test -PSample --ntpDebugging Logs
[INFO] Running TestSuite
2025-10-28T12:57:27.092786007Z SLF4J(W): No SLF4J providers were found.
2025-10-28T12:57:27.092795548Z SLF4J(W): Defaulting to no-operation (NOP) logger implementation
2025-10-28T12:57:27.092796715Z SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
2025-10-28T12:57:27.291898215Z [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.265 s <<< FAILURE! -- in TestSuite
2025-10-28T12:57:27.292031798Z [ERROR] com.test.SampleTest.ExampleTest -- Time elapsed: 0.035 s <<< FAILURE!
2025-10-28T12:57:27.292036090Z org.openqa.selenium.remote.NoSuchDriverException: Unable to obtain: chromedriver, error Unable to obtain Selenium Manager Binary
2025-10-28T12:57:27.292037340Z at org.openqa.selenium.remote.service.DriverFinder.getBinaryPaths(DriverFinder.java:124)
2025-10-28T12:57:27.292038423Z at org.openqa.selenium.remote.service.DriverFinder.getDriverPath(DriverFinder.java:55)
2025-10-28T12:57:27.292039465Z at org.openqa.selenium.chrome.ChromeDriver.generateExecutor(ChromeDriver.java:99)
2025-10-28T12:57:27.292040298Z at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:88)
2025-10-28T12:57:27.292041298Z at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:83)
2025-10-28T12:57:27.292042298Z at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:72)
2025-10-28T12:57:27.292043090Z at com.test.SampleTest.ExampleTest(SampleTest.java:17)
2025-10-28T12:57:27.292043882Z at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
2025-10-28T12:57:27.292045007Z at java.base/java.lang.reflect.Method.invoke(Method.java:580)
2025-10-28T12:57:27.292045757Z at org.testng.internal.invokers.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:141)
2025-10-28T12:57:27.292046632Z at org.testng.internal.invokers.TestInvoker.invokeMethod(TestInvoker.java:687)
2025-10-28T12:57:27.292047423Z at org.testng.internal.invokers.TestInvoker.invokeTestMethod(TestInvoker.java:230)
2025-10-28T12:57:27.292048173Z at org.testng.internal.invokers.MethodRunner.runInSequence(MethodRunner.java:63)
2025-10-28T12:57:27.292048965Z at org.testng.internal.invokers.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:995)
2025-10-28T12:57:27.292049757Z at org.testng.internal.invokers.TestInvoker.invokeTestMethods(TestInvoker.java:203)
2025-10-28T12:57:27.292057173Z at org.testng.internal.invokers.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:154)
2025-10-28T12:57:27.292058090Z at org.testng.internal.invokers.TestMethodWorker.run(TestMethodWorker.java:134)
2025-10-28T12:57:27.292058882Z at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
2025-10-28T12:57:27.292059632Z at org.testng.TestRunner.privateRun(TestRunner.java:741)
2025-10-28T12:57:27.292060340Z at org.testng.TestRunner.run(TestRunner.java:616)
2025-10-28T12:57:27.292061090Z at org.testng.SuiteRunner.runTest(SuiteRunner.java:421)
2025-10-28T12:57:27.292061882Z at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:413)
2025-10-28T12:57:27.292062632Z at org.testng.SuiteRunner.privateRun(SuiteRunner.java:373)
2025-10-28T12:57:27.292063548Z at org.testng.SuiteRunner.run(SuiteRunner.java:312)
2025-10-28T12:57:27.292064340Z at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
2025-10-28T12:57:27.292065132Z at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:95)
2025-10-28T12:57:27.292065840Z at org.testng.TestNG.runSuitesSequentially(TestNG.java:1274)
2025-10-28T12:57:27.292066590Z at org.testng.TestNG.runSuitesLocally(TestNG.java:1208)
2025-10-28T12:57:27.292067340Z at org.testng.TestNG.runSuites(TestNG.java:1112)
2025-10-28T12:57:27.292068257Z at org.testng.TestNG.run(TestNG.java:1079)
2025-10-28T12:57:27.292068965Z at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:308)
2025-10-28T12:57:27.292069757Z at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:71)
2025-10-28T12:57:27.292071798Z at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:113)
2025-10-28T12:57:27.292072590Z at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
2025-10-28T12:57:27.292073382Z at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
2025-10-28T12:57:27.292074173Z at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
2025-10-28T12:57:27.292074923Z at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
2025-10-28T12:57:27.292075673Z Caused by: org.openqa.selenium.WebDriverException: Unable to obtain Selenium Manager Binary
2025-10-28T12:57:27.292076465Z at org.openqa.selenium.manager.SeleniumManager.getBinary(SeleniumManager.java:229)
2025-10-28T12:57:27.292077257Z at org.openqa.selenium.manager.SeleniumManager.getBinaryPaths(SeleniumManager.java:275)
2025-10-28T12:57:27.292078048Z at org.openqa.selenium.remote.service.DriverFinder.getBinaryPaths(DriverFinder.java:104)
2025-10-28T12:57:27.292078840Z ... 36 more
2025-10-28T12:57:27.292079507Z Caused by: org.openqa.selenium.WebDriverException: Linux ARM is not supported by Selenium Manager
2025-10-28T12:57:27.292081173Z Build info: version: '4.38.0', revision: '6b412e825c*'
2025-10-28T12:57:27.292081923Z System info: os.name: 'Linux', os.arch: 'aarch64', os.version: '6.10.14-linuxkit', java.version: '21.0.8'
2025-10-28T12:57:27.292082757Z Driver info: driver.version: ChromeDriver
2025-10-28T12:57:27.292083507Z at org.openqa.selenium.manager.SeleniumManager.getBinary(SeleniumManager.java:205)
2025-10-28T12:57:27.292084257Z ... 38 more
2025-10-28T12:57:27.292084965Z
2025-10-28T12:57:27.298431340Z [INFO]
2025-10-28T12:57:27.298450548Z [INFO] Results:
2025-10-28T12:57:27.298452257Z [INFO]
2025-10-28T12:57:27.298660340Z [ERROR] Failures:
2025-10-28T12:57:27.298733590Z [ERROR] SampleTest.ExampleTest:17 » NoSuchDriver Unable to obtain: chromedriver, error Unable to obtain Selenium Manager Binary
2025-10-28T12:57:27.298748507Z [INFO]
2025-10-28T12:57:27.298880423Z [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
2025-10-28T12:57:27.298887590Z [INFO]
2025-10-28T12:57:27.301052007Z [INFO] ------------------------------------------------------------------------
2025-10-28T12:57:27.301057965Z [INFO] BUILD FAILURE
2025-10-28T12:57:27.301142215Z [INFO] ------------------------------------------------------------------------
2025-10-28T12:57:27.301815923Z [INFO] Total time: 8.993 s
2025-10-28T12:57:27.302003715Z [INFO] Finished at: 2025-10-28T12:57:27Z
2025-10-28T12:57:27.302008590Z [INFO] ------------------------------------------------------------------------
2025-10-28T12:57:27.302421923Z
Sample test:
import org.testng.annotations.Test;
public class SampleTest {
@Test
public void ExampleTest() {
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--headless=new");
chromeOptions.addArguments("--no-sandbox");
chromeOptions.addArguments("--disable-dev-shm-usage");
WebDriver driver = new ChromeDriver(chromeOptions);
driver.get("http://example.com");
System.out.println("title: " + driver.getTitle());
driver.quit();
}
}
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.XXXXX</groupId>
<artifactId>playground</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<selenium.version>4.38.0</selenium.version>
<testng.version>7.11.0</testng.version>
<maven-clean-plugin.version>3.5.0</maven-clean-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
<maven-compiler-plugin.version>3.14.1</maven-compiler-plugin.version>
<maven-surefire-plugin.version>3.5.4</maven-surefire-plugin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven-clean-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<release>21</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>Sample</id>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>sample.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
</dependency>
</dependencies>
</project>
sample.xml (TestNG)
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="Sample" verbose="1">
<test name="Sample">
<classes>
<class name="com.test.SampleTest"/>
</classes>
</test>
<!-- -->
</suite>
IntelliJ Docker run config:
to compare how the same exact code works with 4.36.0:
[INFO] Running TestSuite
2025-10-28T13:27:17.975412763Z SLF4J(W): No SLF4J providers were found.
2025-10-28T13:27:17.975433222Z SLF4J(W): Defaulting to no-operation (NOP) logger implementation
2025-10-28T13:27:17.975435263Z SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
2025-10-28T13:27:19.294864458Z Oct 28, 2025 1:27:19 PM org.openqa.selenium.devtools.CdpVersionFinder findNearestMatch
2025-10-28T13:27:19.294885916Z WARNING: Unable to find an exact match for CDP version 141, returning the closest version; found: 140; Please update to a Selenium version that supports CDP version 141
2025-10-28T13:27:19.697876541Z title: Example Domain
2025-10-28T13:27:19.832409875Z [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.919 s -- in TestSuite
2025-10-28T13:27:19.840122250Z [INFO]
2025-10-28T13:27:19.840129500Z [INFO] Results:
2025-10-28T13:27:19.840130625Z [INFO]
2025-10-28T13:27:19.840311000Z [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
2025-10-28T13:27:19.840315958Z [INFO]
2025-10-28T13:27:19.842744666Z [INFO] ------------------------------------------------------------------------
2025-10-28T13:27:19.842761916Z [INFO] BUILD SUCCESS
2025-10-28T13:27:19.842766041Z [INFO] ------------------------------------------------------------------------
2025-10-28T13:27:19.844377833Z [INFO] Total time: 10.999 s
2025-10-28T13:27:19.844710583Z [INFO] Finished at: 2025-10-28T13:27:19Z
2025-10-28T13:27:19.844719958Z [INFO] ------------------------------------------------------------------------
ℹ️ Last known working version: 4.36.0