playwright 进入调试模式


https://playwright.dev/python/docs/inspector

设置PWDEBUG环境变量以在调试模式下运行脚本。这会配置 Playwright 以进行调试并打开检查器。

打开方式:

1、bash模式:PWDEBUG=1 pytest -s

2、powershell模式:

$env:PWDEBUG=1
pytest -s

3、batch模式:

set PWDEBUG=1
pytest -s

windows pycharm这样可打开debug模式

打开后可以点击开始执行

可以在debug模式下调整元素定位