Skip to content

Unable to connect to the remote-debugging-port via Chome Dev Protocol (CDP) #14835

@tomardern

Description

@tomardern

Current behavior

I am trying to use Chrome Dev Protocol (CDP) to connect to the spawned Chrome Instance via $(npm bin)/cypress open. The overall aim, is to run the built in chrome V8 profiler to get the code coverage for all the files.

To find the port, I've added the following to plugins/index:

on("before:browser:launch", (browser, launchOptions) => {
    console.log(launchOptions.args);
});

Which returns the following:

...
  '--disable-web-security',
  '--allow-running-insecure-content',
  '--proxy-bypass-list=<-loopback>',
  '--remote-debugging-port=64739', <-- This changes each time
  '--remote-debugging-address=127.0.0.1',
  '--remote-debugging-pipe',
...

However, when I try and connect to the spawned CDP (either by opening http://127.0.0.1:64739) or even just running the Port Scan utility on Mac OSX Catalina, I'm unable to see CDP running, and unable to connect.

Interestingly, adding the following to my test script shows the console message, so I presume that Chrome Devtools Protocol is available, just not accessible outside of Cypress.

Cypress.automation("remote:debugger:protocol", {
  command: "Runtime.evaluate",
  params: {
    expression: "console.log('hello world 2');",
  },
});

Desired behavior

Able to connnect to Cypress's spawned Chrome instance via CDP.

Test code to reproduce

(Any basic cypress install, with the above changes in plugins/index

Versions

Cypress: 6.3.0
Node: (12.18.3)
Chrome: Version 88.0.4324.96 (Official Build) (x86_64)
Mac: MacOSX Catalina 10.15.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleno activity on this issue for a long period

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions