microsoft / playwright-python

Python version of the Playwright testing and automation library.
https://playwright.dev/python/
Apache License 2.0
11.51k stars 876 forks source link

[BUG] selector tool in the inspector window doesn't work when execution is paused on a breakpoint #1216

Open DetachHead opened 2 years ago

DetachHead commented 2 years ago

original issue: https://github.com/microsoft/playwright/issues/11668

the solution provided doesn't work unless you are using @playwright/test with nodejs - see https://github.com/microsoft/playwright/issues/11668#issuecomment-1067483802

so this is still a problem when using playwright with python

Context:

mxschmitt commented 2 years ago

Ah yeah the reason for that is that when a Python breakpoint hits, the main event loop halts, then no selector information can be exchanged with Playwright on the Python side itself. Thats why it's stalling.

We usually recommend page.pause() instead, does this work for your use-case?

DetachHead commented 2 years ago

yeah page.pause works but then none of the IDE's debugging features work (variable watch, call stack viewer, python console, etc) because the actual code execution isn't being paused