I'm using MSTest with Playwright in Visual Studio, and am having trouble with a selector. I want to debug using Playwright dev tools, Playwright inspector, etc. This page https://playwright.dev/docs/debug-selectors#using-playwright-inspector suggests setting PWDEBUG=1 or PWDEBUG=console. All the examples show running tests using VS Code, or command line test execution. I'm using Visual Studio 2022 with Test Explorer. Where do I set these variables?
I've tried:
- Using the debug settings environment variables (nothing happens)
- Creating a .runsettings file with the following contents:
<?xml version="1.0" encoding="utf-8" ?> <RunSettings> <EnvironmentVariables> <PWDEBUG>1</PWDEBUG> </EnvironmentVariables> </RunSettings>
Then I used Test -> Configure Run Settings to select this file.
Still no debug console.
What am I missing?