[Bug]: When Debugging test from VSCode the trace is not recorded
Version
v1.56.1
Steps to reproduce
Prerequisite:
- init minimal project - npm init playwright@latest
- VS Code & Plawright VS Code extension installed
Steps to reproduce:
In VS Code:
- open minimal project
- add breakpoint in
has titletest - open Testing tab
- run
Debug testonhas titletest - run
Continueon breakpoint
Expected behavior
- Trace Viewer is populated with new data during debugging
- after test ends Trace Viewer displays whole trace
Actual behavior
- Trace Viewer is not populated with new data (actions, log's, network call's etc.) during debugging
- after test ends Trace Viewer displays
Loading Playwright Trace...message
Additional context
When tests are run with Run Test option Trace Viewer displays trace after run.
Additional env info:
VS Code info:
Version: 1.105.1 (Universal)
Commit: 7d842fb85a0275a4a8e4d7e040d2625abbf7f084
Date: 2025-10-14T22:33:36.618Z
Electron: 37.6.0
ElectronBuildId: 12502201
Chromium: 138.0.7204.251
Node.js: 22.19.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 25.0.0
VS Code PW extension:
Name: Playwright Test for VSCode
Id: ms-playwright.playwright
Description: Run Playwright Test tests in Visual Studio Code.
Version: 1.1.16
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright
Environment
System:
OS: macOS 26.0.1
CPU: (8) arm64 Apple M2
Memory: 4.84 GB / 16.00 GB
Binaries:
Node: 24.10.0 - /opt/homebrew/bin/node
npm: 11.6.0 - /opt/homebrew/bin/npm
IDEs:
VSCode: 1.105.1 - /usr/local/bin/code
Languages:
Bash: 3.2.57 - /bin/bash
npmPackages:
@playwright/test: ^1.56.1 => 1.56.1
I also checked on Windows machine - same result.
VS Code
Version: 1.105.1 (system setup)
Commit: 7d842fb85a0275a4a8e4d7e040d2625abbf7f084
Date: 2025-10-14T22:33:36.618Z
Electron: 37.6.0
ElectronBuildId: 12502201
Chromium: 138.0.7204.251
Node.js: 22.19.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.22631
PW Extension:
Name: Playwright Test for VSCode
Id: ms-playwright.playwright
Description: Run Playwright Test tests in Visual Studio Code.
Version: 1.1.16
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright
Envinfo:
System:
OS: Windows 11 10.0.22631
CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz
Memory: 14.78 GB / 31.39 GB
Binaries:
Node: 22.14.0 - C:\nvm4w\nodejs\node.EXE
npm: 11.2.0 - C:\nvm4w\nodejs\npm.CMD
IDEs:
VSCode: 1.105.1 - C:\Program Files\Microsoft VS Code\bin\code.CMD
Languages:
Bash: 5.2.21 - C:\Windows\system32\bash.EXE
npmPackages:
@playwright/test: ^1.56.1 => 1.56.1
If I had to guess, I'd say it's related to this line in _debugTests() 😁
https://github.com/microsoft/playwright-vscode/blob/c9002ab939db957f28dd68adb1d4f3a8cb061e49/src/testModel.ts#L594
Looking into it!
This is a known problem. For technical reasons, we do not enable tracing when running with the "Show browser" or when debugging that uses "Show browser" under the hood.
The possible fix is risky, so I'll keep the issue open for prioritization. Given enough interest in this, the benefit might as well outweigh the risk, and we'll try the fix.