在Visual Studio 2022中调试Playwright MSTest:如何设置PWDEBUG变量?
在Visual Studio 2022中使用MSTest+Playwright时,无法通过PWDEBUG启动Playwright Inspector的问题
我在Visual Studio 2022中使用MSTest结合Playwright进行UI测试,目前遇到选择器定位的问题,想要通过Playwright DevTools或Playwright Inspector工具调试。根据Playwright官方文档的建议,设置环境变量PWDEBUG=1或PWDEBUG=console可以唤起调试工具,但官方示例都是基于VS Code或命令行执行测试的场景。
我在Visual Studio 2022的Test Explorer中尝试了两种方式,均未成功弹出调试控制台:
- 在调试设置中添加环境变量
PWDEBUG=1,无效果; - 创建了
.runsettings文件,配置内容如下:
<?xml version="1.0" encoding="utf-8" ?> <RunSettings> <EnvironmentVariables> <PWDEBUG>1</PWDEBUG> </EnvironmentVariables> </RunSettings>
通过“测试->配置运行设置”选择该文件后,执行测试仍无法唤起调试工具。
请问我遗漏了哪些配置步骤?
内容的提问来源于stack exchange,提问作者Tony Isaac
相关产品推荐
相关产品推荐

