Skip to content

Fix: playwright scrolling element into view #654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

seanmcguire12
Copy link
Member

why

  • if performPlaywrightMethod is attempting to click an element, and the chosen element does not pass playwright's actionability check (more information here), the click will fail even if the element is actually clickable
  • this failure case is often characterized by repeated up & down scrolling for 30 seconds, and then the act ultimately fails
    • this is playwright attempting to scroll the element into view so it can pass the actionability check

what changed

  • to address the issue, we set a timeout for the actionability check, and if it times out, we retry with force: true

test plan

  • added an eval

Copy link

changeset-bot bot commented Apr 9, 2025

🦋 Changeset detected

Latest commit: 78bbd72

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@browserbasehq/stagehand Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This pull request introduces a new google_flights eval to test forced click behavior and refines the click handling to retry with force: true after a timeout.

  • Updated /evals/evals.config.json to include the new 'google_flights' task under the 'act' category.
  • Added /evals/tasks/google_flights.ts eval to validate forced navigation on actionability failure.
  • Modified /lib/handlers/handlerUtils/actHandlerUtils.ts to add a timeout and forced click logic, with a potential risk of suppressing non-timeout errors.

3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

@seanmcguire12 seanmcguire12 merged commit 57a9853 into main Apr 11, 2025
13 checks passed
@github-actions github-actions bot mentioned this pull request Apr 11, 2025
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.

2 participants