diff --git a/driver-bundle/src/main/java/com/microsoft/playwright/impl/DriverJar.java b/driver-bundle/src/main/java/com/microsoft/playwright/impl/DriverJar.java index 202a0871..86f3fe22 100644 --- a/driver-bundle/src/main/java/com/microsoft/playwright/impl/DriverJar.java +++ b/driver-bundle/src/main/java/com/microsoft/playwright/impl/DriverJar.java @@ -26,6 +26,7 @@ import java.util.concurrent.TimeUnit; public class DriverJar extends Driver { private static final String PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD"; + private static final String SELENIUM_REMOTE_URL = "SELENIUM_REMOTE_URL"; private final Path driverTempDir; public DriverJar() throws IOException { @@ -57,6 +58,10 @@ public class DriverJar extends Driver { System.out.println("Skipping browsers download because `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` env variable is set"); return; } + if (env.get(SELENIUM_REMOTE_URL) != null || System.getenv(SELENIUM_REMOTE_URL) != null) { + logMessage("Skipping browsers download because `SELENIUM_REMOTE_URL` env variable is set"); + return; + } Path driver = driverPath(); if (!Files.exists(driver)) { throw new RuntimeException("Failed to find driver: " + driver);