A returned WebDriver capability is serialized data. Its proxy entry can be a map rather than an existing org.openqa.selenium.Proxy object.

For a ChromeDriver or RemoteWebDriver instance, Selenium Java provides a conversion helper:

Proxy proxy = Proxy.extractFrom(driver.getCapabilities());
if (proxy != null) {
    System.out.println(proxy.getProxyType());
    System.out.println(proxy.getHttpProxy());
    System.out.println(proxy.getSslProxy());
}

The helper handles both a map and a Proxy instance. It returns null when there is no supported value to extract. A direct cast of getCapability("proxy") assumes one representation and can fail for the other.

Keep the mode with the fields you inspect. A PAC or system configuration need not contain the same manual HTTP and HTTPS endpoint strings.

The capability is configuration data, not a health check. It does not prove that a listener accepted a connection or report every per-destination PAC decision. A missing manual entry also does not independently prove that the browser has no system-derived proxy route.

Erthyglow kevrennek