-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[Feature] debugging client script #1400
Comments
hmm. this only happens when running with jest. is there an easy way to attach the chrome debugger without having a breakpoint in the code and then manually running the attach chrome configuration and continuing execution? |
If you'd like to step over the injected (evaluated) code, there is nothing better than VSCode or Chrome DevTools. What did you have in mind? It is technically feasible for us to implement a story where you would step into that evaluate while debugging the top-level script. Not something we would do for v1, but something that we might consider doing as a part of the tooling story for Playwright. Is that something you were looking for? |
my issue here is the tooling. {
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${file}",
"cwd": "${workspaceFolder}",
},
{
"type": "chrome",
"request": "attach",
"name": "Attach to Chrome",
"port": 9222,
"webRoot": "${workspaceFolder}"
}
]
} in order to debug the client script I need to attach the chrome debugger while the playwright script is running, my goal is to attach automatically and I'm hoping that there's a way to have a single configuration that will run and then attach. |
With {
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${file}",
"cwd": "${workspaceFolder}",
"env": {
// Use remote debugging port.
"PLAYWRIGHT_CHROMIUM_DEBUG_PORT": "9222",
// Run Playwright in debug mode.
"PWDEBUG": "true"
},
},
{
"type": "chrome",
"request": "attach",
"name": "Attach to Chrome",
"port": 9222,
"webRoot": "${workspaceFolder}"
}
]
} |
Closing for now. Please reopen if something does not work. |
I have a case where I'm executing a script in the browser using
page.evaluate
and I'm trying to debug that script;I tried installing https://github.com/microsoft/vscode-chrome-debug and configuring playwright to connect locally using websocket and port 9222.
with the configuration
for example:
I set a breakpoint right before the
page.evaluate
execution and then started the chrome debuggervscode was able to list the opened pages but when I selected one I got the following error:
Could not load source '__playwright_evaluation_script__': No debug adapter found. Can not send 'source'..
is this something that could work? or should work?
The text was updated successfully, but these errors were encountered: