Skip to content

[🐛 Bug]: a value is required for '--proxy ' but none was supplied with ProxyType.DIRECT #14162

@Jobvdb

Description

@Jobvdb

What happened?

Im developing a test automation app that uses Selenium and with upgrading from 4.18.1 to 4.21.0, I got this error: Unable to obtain: chromedriver, error Command failed with code: 2, executed: [--browser, chrome, --proxy, --language-binding, java, --output, json] error: a value is required for '--proxy ' but none was supplied For more information, try '--help'.

In the example below, I'm using ProxyType.DIRECT, but any type will trigger this behavior (including AUTODETECT)

How can we reproduce the issue?

@Test
    void withProxy() {
        org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
        proxy.setProxyType(org.openqa.selenium.Proxy.ProxyType.DIRECT);
        ChromeOptions chromeOptions = new ChromeOptions();
        chromeOptions.setProxy(proxy);
        new ChromeDriver(chromeOptions);
    }

Relevant log output

org.openqa.selenium.remote.NoSuchDriverException: Unable to obtain: chromedriver, error Command failed with code: 2, executed: [--browser, chrome, --proxy, --language-binding, java, --output, json]
error: a value is required for '--proxy <PROXY>' but none was supplied

For more information, try '--help'.

        at org.openqa.selenium.remote.service.DriverFinder.getBinaryPaths(DriverFinder.java:121)
        at org.openqa.selenium.remote.service.DriverFinder.getDriverPath(DriverFinder.java:55)
        at org.openqa.selenium.chrome.ChromeDriver.generateExecutor(ChromeDriver.java:99)
        at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:88)
        at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:83)
        at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:72)
        at nl.testautomaat.test.driver.web.RemoteTest.withProxy(RemoteTest.java:27)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Caused by: org.openqa.selenium.WebDriverException: Command failed with code: 2, executed: [--browser, chrome, --proxy, --language-binding, java, --output, json]
error: a value is required for '--proxy <PROXY>' but none was supplied

For more information, try '--help'.

        at org.openqa.selenium.manager.SeleniumManager.runCommand(SeleniumManager.java:169)
        at org.openqa.selenium.manager.SeleniumManager.getBinaryPaths(SeleniumManager.java:244)
        at org.openqa.selenium.remote.service.DriverFinder.getBinaryPaths(DriverFinder.java:102)
        ... 9 more
Caused by: org.openqa.selenium.json.JsonException: Unable to parse: error: a value is required for '--proxy <PROXY>' but none was supplied

For more information, try '--help'.

        at org.openqa.selenium.json.Json.toType(Json.java:169)
        at org.openqa.selenium.json.Json.toType(Json.java:152)
        at org.openqa.selenium.manager.SeleniumManager.runCommand(SeleniumManager.java:154)
        ... 11 more
Caused by: org.openqa.selenium.json.JsonException: Unable to determine type from: e. Last 1 characters read: e, next 107 characters to read: rror: a value is required for '--proxy <PROXY>' but none was supplied

For more information, try '--help'.

Build info: version: '4.21.0', revision: '79ed462ef4'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '14.0', java.version: '21.0.1'
Driver info: driver.version: ChromeDriver
        at org.openqa.selenium.json.JsonInput.peek(JsonInput.java:166)
        at org.openqa.selenium.json.JsonTypeCoercer.lambda$buildCoercer$6(JsonTypeCoercer.java:167)
        at org.openqa.selenium.json.JsonTypeCoercer.coerce(JsonTypeCoercer.java:146)
        at org.openqa.selenium.json.Json.toType(Json.java:206)
        at org.openqa.selenium.json.Json.toType(Json.java:167)
        ... 13 more

Operating System

macOS

Selenium version

Java 4.21.0

What are the browser(s) and version(s) where you see this issue?

Chrome 126.0.6478.62 (Official build) (arm64)

What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver 126.0.6478.62

Are you using Selenium Grid?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-javaJava BindingsI-defectSomething is not working as intended

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions