Skip to content

fix: prevent type action text from being used as element locator#24

Open
sow-akash-mole wants to merge 1 commit into
vercel-labs:mainfrom
shades-of-web:fix/type-action-resolve-target
Open

fix: prevent type action text from being used as element locator#24
sow-akash-mole wants to merge 1 commit into
vercel-labs:mainfrom
shades-of-web:fix/type-action-resolve-target

Conversation

@sow-akash-mole

Copy link
Copy Markdown

Summary

  • Fixes a bug where the type action's text field (intended as content to type) is incorrectly passed to resolveTarget, which interprets it as an element locator
  • When both text and selector are provided on a type step, resolveTarget checks text first and fails with Element not found: text="<typed content>"
  • The fix passes only { selector, within } to resolveTarget, keeping text reserved for the content to type

Reproduction

{
  "action": "type",
  "text": "user@example.com",
  "selector": "#email"
}

This fails with:

Element not found: text="user@example.com"

Because resolveTarget receives the full step object and prioritizes opts.text (line 81 of runner.ts) over opts.selector, treating the typed content as an element search query.

Fix

- const box = await resolveTarget(client, step);
+ const box = await resolveTarget(client, { selector: step.selector, within: step.within });

Test plan

  • Verify type action with both text and selector correctly types into the targeted element
  • Verify type action without selector still works (no change to that path)
  • Verify existing click, hover, moveTo actions still resolve elements correctly (unchanged)

🤖 Generated with Claude Code

…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>
@vercel

vercel Bot commented Apr 1, 2026

Copy link
Copy Markdown

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant