Skip to content

[🐛 Bug]: Unable to connect to an existing chrome instance with capabilities #14591

@wojtekantolik

Description

@wojtekantolik

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

9.15.0

Node.js Version

22.12.0

Mode

WDIO Testrunner

Which capabilities are you using?

capabilities: {
    "wdio:enforceWebDriverClassic": true,
    browserName: "chrome",
    browserVersion: "136",
    "goog:chromeOptions": {
      debuggerAddress: "127.0.0.1:54213",
    },
    "wdio:devtoolsOptions": {
      defaultViewport: null,
    },
  },

What happened?

After #14427

I get the following error

WebDriverError: invalid argument: cannot parse capability: goog:chromeOptions
[0-18] from invalid argument: unrecognized chrome option: prefs when running "http://localhost:64889/session" with method "POST" and args "{"capabilities":{"alwaysMatch":{"wdio:enforceWebDriverClassic":true,"browserName":"chrome","browserVersion":"136","goog:chromeOptions":{"binary":"C:\Users\PKRUKO~1\AppData\Local\Temp\chrome\win64-136.0.7103.113\chrome-win64\chrome.exe","prefs":{"profile.password_manager_leak_detection":false},"debuggerAddress":"127.0.0.1:54213"},"wdio:devtoolsOptions":{"defaultViewport":null}},"firstMatch":[{}]}}"

This is happening when I want to connect to an existing browser instance, which is required for me as I'm testing a windows app with web based plugins inside it, previously I was able to run it with the above capabilities.

The issue can be also reproduced with launching a chrome instance with a terminal command and then trying to connect with a remote debugger to it in chrome capabilities

What is your expected behavior?

To have the option remove prefs

How to reproduce the bug.

Open chrome with command prompt on a remote debugger
Connect to the chrome instance in wdio capabilities by the remote debugger port

Relevant log output

WebDriverError: invalid argument: cannot parse capability: goog:chromeOptions
[0-18] from invalid argument: unrecognized chrome option: prefs when running "[http://localhost:64889/session"](http://localhost:64889/session%22) with method "POST" and args "{"capabilities":{"alwaysMatch":{"wdio:enforceWebDriverClassic":true,"browserName":"chrome","browserVersion":"136","goog:chromeOptions":{"binary":"C:\\Users\\PKRUKO~1\\AppData\\Local\\Temp\\chrome\\win64-136.0.7103.113\\chrome-win64\\chrome.exe","prefs":{"profile.password_manager_leak_detection":false},"debuggerAddress":"127.0.0.1:54213"},"wdio:devtoolsOptions":{"defaultViewport":null}},"firstMatch":[{}]}}"

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🐛help wantedIssues that are free to take by anyone interested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions