Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

How to add args to goog:chromeOptions when creating a chromeDriver? #43

Closed
@dunand

Description

@dunand

When creating a webdriver. I need the possibility to add arguments. Like the two proxy args below:

case "googlechromeheadless":
   desiredCapabilities = new ChromeOptions();
   logging.debug("Parsing chrome options: "+browserOptions);
   parseBrowserOptionsChrome(browserOptions, desiredCapabilities);
   ((ChromeOptions)desiredCapabilities).setHeadless(true);
   ((ChromeOptions)desiredCapabilities).addArguments("--proxy-server='direct://'", "--proxy-bypass-list=*"); 
   break;

How can I add the goog:chromeOptions args without modifying the source code?

When I look at the chromeDriver log, I need to see something like this:

"desiredCapabilities": {
         "acceptInsecureCerts": true,
         "browserName": "chrome",
         "goog:chromeOptions": {
            "args": [ "--proxy-server=direct://", "--proxy-bypass-list=*" ],
            "extensions": [  ]
         }
      }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions