You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Record at cursor inserts stale/previous action after editing test while recording (browser focus loss) #42218
@playwright/test: 1.62.1, Playwright Test for VS Code extension: 1.1.19, macOS
Steps to reproduce
Enable Show browser in the Playwright Testing sidebar.
Run a test so the browser is left open at a useful page state.
Place the cursor inside the test where new steps should be inserted.
Click Record at cursor.
Perform a few actions in the browser — they are inserted correctly at the cursor.
Switch focus to the editor and manually edit the test (e.g. tidy a locator, add a comment, delete a generated line, move the cursor).
Switch back to the browser without stopping recording.
Perform one more click/action in the browser.
Expected behavior
Only the new action is appended at the current cursor position.
Actual behavior
The new action is recorded, and an extra stale action is also inserted — typically the last (or penultimate) action from earlier in the same recording session, or sometimes from a previous recording session.
Additional context
Workaround
Stop recording before editing the file. After editing, click Record at cursor again and continue. That avoids the stale action, but significantly slows the record → tidy → continue workflow.
Notes
If I stay entirely in the browser and never edit mid-recording, generation behaves correctly.
The failure is specifically tied to leaving the browser / editing the file while recording remains active, then resuming clicks.
This feels like the recorder’s internal action buffer / document rewrite getting out of sync with the editor buffer (similar class of issue to editing-while-recording problems discussed in #17771).
Environment
@playwright/test: 1.62.1
Playwright VS Code extension: 1.1.19
IDE: Cursor (VS Code-compatible)
OS: macOS Darwin 25.x
We're closing all P3-collecting-feedback issues and retiring the label. #43813 explains why. This doesn't mean the request is wrong. If it still matters to you, please open a new issue against the latest Playwright version with your concrete use case and link back here.
Activity
test: cover stale actions from the previous recording session
pavelfeldman commentedon Oct 31, 2026
We're closing all
P3-collecting-feedbackissues and retiring the label. #43813 explains why. This doesn't mean the request is wrong. If it still matters to you, please open a new issue against the latest Playwright version with your concrete use case and link back here.