Repository navigation
fix(recorder): pick on the page the user works on - #5424
Merged
Merged
Conversation
The toolbar's Pick button picked, counted and highlighted on Browser's active page, which a recording never changes: after a popup it picked on the page behind it. A pick now starts on the page whose toolbar sent the command, or, for Playwright's Pick locator button, on the page pressed last, and counts and highlights on the page it picked in.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the changes that keep recorder picks tied to the user’s working page.
No open issues 🎉
What changed in this PR
This PR makes recorder picks follow the page the user is working on rather than Browser’s active page, addressing picks that return to the original tab after opening a new one.
Changes:
- Tracks toolbar command origins and recent presses to choose the page for a new pick.
- Counts and highlights selectors on the page where they were picked.
- Adds multi-window acceptance tests and updates page-specific unit coverage.
| File | Description |
|---|---|
node/playwright-wrapper/static/recorder-toolbar.js |
Tracks trusted presses and clears tracking on removal. |
node/playwright-wrapper/selector-picker.ts |
Uses the page-bound picker interface. |
node/playwright-wrapper/recorder.ts |
Routes new picks to the user’s page while preserving existing selections. |
node/playwright-wrapper/playwright-invoke.ts |
Adds selector resolution on an explicit page. |
node/playwright-wrapper/element-picker.ts |
Counts and highlights using the pick’s page. |
node/playwright-wrapper/__tests__/selector-picker.test.ts |
Updates mocks and verifies page-specific locator use. |
atest/test/02_Content_Keywords/recorder.robot |
Adds multi-window coverage for both pick entry points. |
Review effort: Balanced
On Python 3.11 a comprehension has its own scope, where Robot Framework cannot resolve `$before`; a set difference needs none.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
The toolbar's Pick button, and Playwright's own Pick locator button, picked on Browser's active page. A recording never changes that page, so after a click that opened a new tab the pick jumped back to the original tab.
Reproduce with Browser 21.0.0:
Click More info, which opens robocon.io in a new tab; the recording adds
Switch Page NEW. Press Pick in the new tab: the pick runs on robotframework.org instead.Fix
exposeBindingpasses the page a toolbar command comes from.locatorOn).Tests
Pick Starts On The Page Its Button Was Pressed On: Browser's active page stays the first one, and the pick command comes from the toolbar of a second window.Playwright's Pick Locator Picks On The Page Pressed Last: a press on the second window, then Playwright's Pick locator; the pick must arrive there.