Skip to content

observe/act returning unresolvable xpath locators #657

Description

@dnwarnock

I'm really impressed with the Stagehand and Browserbase setup! We're currently exploring the possibility of transitioning from our proprietary natural language action translation layer to Stagehand. To evaluate its suitability, I'm trying to verify Stagehand's functionality against some simulated webpages.

Unfortunately, I've noticed that some of the XPath locators returned by observer/act don't seem specific enough for Playwright to efficiently interact with the intended HTML elements. I was wondering if there are any configuration options I can adjust to obtain more specific locators?

I've also attempted to modify the timeoutMs option when calling act, but it appears to be consistently stuck at 30 seconds.

Any advice or insights on how to improve XPath specificity and address the timeoutMs issue would be greatly appreciated.

Thanks in advance!

`

var [topAction] = await p.observe({instruction: "Click the 'Statements & documents' link"});
undefined
topAction
{
description: "The 'Statements & documents' link in the main section of the page.",
method: 'click',
arguments: [],
selector: 'xpath=/div/a[1]'
}
var res = await p.act(topAction)
undefined
res
{
success: false,
message: 'Failed to perform act: locator.evaluate: Timeout 30000ms exceeded.\n' +
'Call log:\n' +
"\x1B[2m - waiting for locator('xpath=/div/a[1]').first()\x1B[22m\n",
action: "The 'Statements & documents' link in the main section of the page."
}
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions