You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 1, 2026. It is now read-only.
This repository was archived by the owner on Sep 1, 2026. It is now read-only.
stagehand action occasionally return two xpath which locates the same object but one of them successfully click the button while the other does not #253
stagehand action return two xpath locates the same object but one of them successfully click the button while the other does not
Steps to Reproduce
stagehand action to click a login button
check the results
Minimal Reproduction Code
import asyncio
from stagehand import Stagehand
async def main():
stagehand = Stagehand(
env="LOCAL",
model_name="google/gemini-2.5-flash",
model_api_key=os.getenv("GOOGLE_API_KEY")
)
await stagehand.init()
page = stagehand.page
await page.goto("https://mywebapp.com")
# Act on the page
await page.act("Click the Login button")
await page.act("Input email abc@email.com")
await stagehand.close()
if __name__ == "__main__":
asyncio.run(main())
Error Messages / Log trace
correctly click the button xpath=/html/body[1]/div[1]/div[1]/div[2]/nav[1]/div[1]/div[3]/button[1]/span[1]
cannot click the button xpath=/html/body[1]/div[3]/div[1]/div[1]/div[1]/div[1]/form[1]/div[3]/button[1].
Before submitting an issue, please:
Environment Information
Please provide the following information to help us reproduce and resolve your issue:
Stagehand:
AI Provider:
Issue Description
Steps to Reproduce
Minimal Reproduction Code
Error Messages / Log trace
Screenshots / Videos
Related Issues
Are there any related issues or PRs?