playwright-python icon indicating copy to clipboard operation
playwright-python copied to clipboard

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

Open DetachHead opened this issue 3 years ago • 2 comments

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:

  • Playwright Version: 1.19.0
  • Operating System: windows 10
  • Python version: 3.10
  • Browser: chromium

DetachHead avatar Mar 21 '22 01:03 DetachHead

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?

mxschmitt avatar Mar 21 '22 14:03 mxschmitt

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

DetachHead avatar Mar 21 '22 22:03 DetachHead