Manuals / Playwright with Python / Chapter 32
Part 4 · Advanced Techniques · advanced · ~45 min · Chapter 32 of 61
24. Debugging Tools
Playwright Inspector PWDEBUG=1 pytest test_login.py What it does: Opens a GUI tool that pauses test execution and lets you step through actions one at a time, inspect the current page state, and even generate locator code by pointing at elements live. Pointers: Invaluable while first writing a new test or diagnosing exactly where an existing one breaks — far faster than repeatedly adding print sta
Step 1 of 2
PWDEBUG=1 pytest test_login.py
What it does: Opens a GUI tool that pauses test execution and lets you step through actions one at a time, inspect the current page state, and even generate locator code by pointing at elements live. Pointers: Invaluable while first writing a new test or diagnosing exactly where an existing one breaks — far faster than repeatedly adding print statements and re-running.
Chapter learning outcomes
- PWDEBUG=1 pytest test_login.py
- Trace Viewer
Clear these before you leave
Side quest
24. Debugging Tools deliverable
Apply one idea from “PWDEBUG=1 pytest test_login.py” in a small script or note.