Skip to content

Conversation

@simone-costamagna
Copy link

Use case: Task agent.

Issue: During the execution of Click(), when reaching the following code:
await page.locator(f'xpath={xpath}').click(
modifiers=["Control"],
timeout=5000,
force=attempts == max_attempts
)

An exception occurs because the given XPath refers to multiple elements, but it should only refer to the first element [1].

Fix: Added the string [index] to the XPath also for the first element when retrieving elements via JavaScript.


Additional changes: Refactored the prompt to replace negative expressions such as "don't" with positive alternatives like "avoid".

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