Java runner → configured proxy → WebDriver service
remote browser → its own route → website

For the first path, configure the Java command executor:

import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.URI;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.HttpCommandExecutor;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.remote.http.ClientConfig;

var proxy = new Proxy(Proxy.Type.HTTP,
    new InetSocketAddress("proxy.example", 8080));
var config = ClientConfig.defaultConfig()
    .baseUri(URI.create("https://grid.example/"))
    .proxy(proxy);
var executor = new HttpCommandExecutor(config);
var driver = new RemoteWebDriver(executor, new ChromeOptions());

Use the real Grid endpoint, including its deployed path. Preserve required Chrome options and end the session with driver.quit().

This is java.net.Proxy for the runner's HTTP connection. Selenium's org.openqa.selenium.Proxy capability governs browser page traffic instead; use it too only when the second path needs a proxy.

A session-creation or command-send failure belongs to the first path. A later navigation can fail on the second. Authentication to the runner's intermediary needs that HTTP transport's supported scheme; a browser authentication callback does not configure it.

Mikanda mikatakata