fix: prevent type action text from being used as element locator#24
Open
sow-akash-mole wants to merge 1 commit into
Open
fix: prevent type action text from being used as element locator#24sow-akash-mole wants to merge 1 commit into
sow-akash-mole wants to merge 1 commit into
Conversation
…esolveTarget
When the `type` action has both `text` (content to type) and `selector`
(element to target), `resolveTarget` receives the full step object and
incorrectly uses `text` as an element locator instead of `selector`.
This causes `Element not found: text="<typed content>"` errors.
Pass only `{ selector, within }` to `resolveTarget` so the `text` field
is correctly reserved for the content to type.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@sow-akash-mole is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
typeaction'stextfield (intended as content to type) is incorrectly passed toresolveTarget, which interprets it as an element locatortextandselectorare provided on atypestep,resolveTargetcheckstextfirst and fails withElement not found: text="<typed content>"{ selector, within }toresolveTarget, keepingtextreserved for the content to typeReproduction
{ "action": "type", "text": "user@example.com", "selector": "#email" }This fails with:
Because
resolveTargetreceives the full step object and prioritizesopts.text(line 81 of runner.ts) overopts.selector, treating the typed content as an element search query.Fix
Test plan
typeaction with bothtextandselectorcorrectly types into the targeted elementtypeaction withoutselectorstill works (no change to that path)click,hover,moveToactions still resolve elements correctly (unchanged)🤖 Generated with Claude Code