-
Notifications
You must be signed in to change notification settings - Fork 955
trim /text()[1]
from xpaths
#826
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
trim /text()[1]
from xpaths
#826
Conversation
🦋 Changeset detectedLatest commit: c2800ba The changes in this PR will be included in the next version bump. 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Added new trimTrailingTextNode
utility function to fix text node interaction issues in XPath selectors, improving element targeting reliability.
- Added new function in
lib/utils.ts
to remove/text()[1]
from XPath selectors, preventing invalid Playwright operations - Modified
lib/handlers/observeHandler.ts
to use the new function when processing accessibility tree StaticText nodes - Fix ensures Playwright targets parent elements instead of text nodes for interactions
- Solution specifically addresses issue #824 where LLM was selecting StaticText nodes incorrectly
2 files reviewed, no comments
Edit PR Review Bot Settings | Greptile
# Releases ## @browserbasehq/[email protected] ### Minor Changes - [#819](#819) [`6a18c1e`](6a18c1e) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - try playwright click and fall back to JS click event ### Patch Changes - [#826](#826) [`124e0d3`](124e0d3) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - fix issue where we are unable to take actions on text nodes - [#818](#818) [`1660751`](1660751) Thanks [@miguelg719](https://github.com/miguelg719)! - Added CUA support for Claude 4 models - [#821](#821) [`cadac9d`](cadac9d) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - use playwright instead of playwright test - [#832](#832) [`759da55`](759da55) Thanks [@miguelg719](https://github.com/miguelg719)! - Fix \_refreshPageFromAPI to use parametrized apiKey - [#810](#810) [`a175a51`](a175a51) Thanks [@miguelg719](https://github.com/miguelg719)! - Update logos - [#822](#822) [`8527a80`](8527a80) Thanks [@miguelg719](https://github.com/miguelg719)! - Add model with date tag for OpenAI CUA - [#833](#833) [`55fca2f`](55fca2f) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - adjust stagehandLogger.warn() level to be 1 instead of 0 ## @browserbasehq/[email protected] ### Patch Changes - [#831](#831) [`5812b02`](5812b02) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - added -man & -h commands for explaining how to run evals - Updated dependencies \[[`124e0d3`](124e0d3), [`6a18c1e`](6a18c1e), [`1660751`](1660751), [`cadac9d`](cadac9d), [`759da55`](759da55), [`a175a51`](a175a51), [`8527a80`](8527a80), [`55fca2f`](55fca2f)]: - @browserbasehq/[email protected] ## @browserbasehq/[email protected] ### Patch Changes - Updated dependencies \[[`124e0d3`](124e0d3), [`6a18c1e`](6a18c1e), [`1660751`](1660751), [`cadac9d`](cadac9d), [`759da55`](759da55), [`a175a51`](a175a51), [`8527a80`](8527a80), [`55fca2f`](55fca2f)]: - @browserbasehq/[email protected] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
why
what changed
trimTrailingTextNode
which trims the text node from the xpathtest plan
act
,observe
,targeted_extract
,combination
,regression