Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could support for context.newCDPSession() to enable developers to send commands via the Chrome DevTools Protocol? #4569

Open
fedono opened this issue Feb 20, 2025 · 3 comments
Assignees

Comments

@fedono
Copy link

fedono commented Feb 20, 2025

Feature Description

could support for context.newCDPSession() to enable developers to send commands via the Chrome DevTools Protocol
or is there any way to create newCDPSession by current method?

Suggested Solution (optional)

No response

Already existing or connected issues / PRs (optional)

No response

@inancgumus
Copy link
Member

inancgumus commented Feb 20, 2025

Yes, that's correct. However, we don't currently expose the newCDPSession method. Can you explain your use case for sending custom commands?

@inancgumus inancgumus removed their assignment Feb 20, 2025
@fedono
Copy link
Author

fedono commented Feb 21, 2025

Yes, that's correct. However, we don't currently expose the newCDPSession method. Can you explain your use case for sending custom commands?

@inancgumus we have some scenes, eg

  1. use Page.screencastFrame for recording videos when run tests
  2. set Log.enable to recording the page logs so that we can check page errors
  3. set Network.enable and use some methods like Network.dataReceived to recording whole network traffics

@inancgumus
Copy link
Member

inancgumus commented Feb 21, 2025

From what I see, you need three extra features, but (I believe) you want to use them without waiting for us to implement them. However, adding direct access to CDPSession might have security implications we cannot foresee for now.

  1. use Page.screencastFrame for recording videos when run tests

We're open to contributions for this extra feature if you're interested 🙇

  1. set Log.enable to recording the page logs so that we can check page errors

We automatically enable Log.enable. You can see these logs by passing K6_BROWSER_DEBUG=debug environment variable to the k6 command. Search for browser_source in the logs using grep or any other favorite tool.

  1. set Network.enable and use some methods like Network.dataReceived to recording whole network traffics

We automatically enable Network.enable. For you to process the requests and responses, the next version will come with #4281 and #4296. It looks like it can be helpful for your usecase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants