People must be excited for this since a lot of people are commenting for the first time in months or years to say how much they love it. Some people liked it so much they commented for the first time ever to say how great it is.
This is 100% the future of UI testing. The dream of BDD and Gherkin can be fully realized now that the actual test code writing/maintenance portion is completely taken care of.
Show HN: Stagehand – an open source browser automation framework powered by AI
51–60 of 89 posts
Re: Show HN: Stagehand – an open source browser automation framework powered by AI
#52This looks very cool and makes a lot of sense, except for the idea that it should take the place of Playwright et al. Personally I'd love to use this as an intermediate workflow for producing deterministic playwright code, but it looks like this is intended for running directly. I don't think I could plausibly argue for using LLMs at runtime in our test suite at work...
It's funny you mentioned "deterministic Playwright code," because in my experience, that’s one of the most frustrating challenges of writing integration tests with browser automation tools. Authoring tests is relatively easy, but creating reliable, deterministic tests is much harder. Most of my test failures come down to timing issues—CPU load subtly affects execution, leading to random timeouts. This makes it diffic…
Basically, the goal would be to do it like with screenshot regression tests: basically you get 2 different execution phases: - generate - verify
And when verify fails in CI, you can automatically run a generate and open a MR/PR with the new script.
This let's you audit the script and make a plausibility check and you'll be notified on changes but have minimal effort to keep the tests running
Re: Show HN: Stagehand – an open source browser automation framework powered by AI
#53People must be excited for this since a lot of people are commenting for the first time in months or years to say how much they love it. Some people liked it so much they commented for the first time ever to say how great it is.
Re: Show HN: Stagehand – an open source browser automation framework powered by AI
#54This looks awesome. What I would love to see either as something leveraging this, or built in to this, is if you prompt stagehand to extract data from a page, it also returns the xpath elements you'd use to re-scrape the page without having to use an LLM to do that second scraping. So basically, you can scrape new pages never before seen with the non-deterministic LLM tool, and then when you need to rescrape the page…
I'm still trying to figure out the boundaries of where and how I want to scale that out into other stuff -- things like when to use `page` methods directly, vs passing a function into `page.evaluate`, vs other alternatives like a browser extension or a CLI tool. And I'm still needing to work around smaller issues with the polyfill and its spec coverage (leaving me to use things like `getAttribute` more than I would otherwise). But in the meantime it's simplified a lot of ancillary issues, like handling failures on my existing workflows and scaling out to new targets, while I work on other bot detection issues.
Re: Show HN: Stagehand – an open source browser automation framework powered by AI
#55Re: Show HN: Stagehand – an open source browser automation framework powered by AI
#56This looks very cool and makes a lot of sense, except for the idea that it should take the place of Playwright et al. Personally I'd love to use this as an intermediate workflow for producing deterministic playwright code, but it looks like this is intended for running directly. I don't think I could plausibly argue for using LLMs at runtime in our test suite at work...
Treating UI test code as some kind of static source of truth is the biggest nightmare in all of UI front end development. Web UIs naturally have a ton of "jank" that accumulates over time, which leads to a ton of false negatives; slow API calls, random usages of websockets/SSE, invisible elements, non-idempotent endpoints, etc. etc. And having to write "deterministic" test code for those is the single biggest reason why no one ever actually does it.
I don't care that the page I'm testing has a different DOM structure now, or uses a different button component with a different test ID. All I care about is "can the user still complete X workflow after my changes have been made". If the LLM wants to completely rewrite the underlying test code, I couldn't care less so long as it still achieves that result and is assuring me that my application works as intended E2E.
Re: Show HN: Stagehand – an open source browser automation framework powered by AI
#57Earlier quoted context omitted.
This is 100% the future of UI testing. The dream of BDD and Gherkin can be fully realized now that the actual test code writing/maintenance portion is completely taken care of.
This thing that was just released is the future of UI testing? I usually just use the UI to test it.
The general idea of it, yes. No one will be writing selector based tests by hand anymore in a couple years.
Re: Show HN: Stagehand – an open source browser automation framework powered by AI
#58This looks very cool and makes a lot of sense, except for the idea that it should take the place of Playwright et al. Personally I'd love to use this as an intermediate workflow for producing deterministic playwright code, but it looks like this is intended for running directly. I don't think I could plausibly argue for using LLMs at runtime in our test suite at work...
>Personally I'd love to use this as an intermediate workflow for producing deterministic playwright code, but it looks like this is intended for running directly. Treating UI test code as some kind of static source of truth is the biggest nightmare in all of UI front end development. Web UIs naturally have a ton of "jank" that accumulates over time, which leads to a ton of false negatives; slow API calls, random usag…
It is, in fact, very possible to extract value from testing methods like this, provided you take the proper care and control both the UI and the tests. It's definitely very easy to end up with a flaky suite of tests that's a net drag on productivity, but it's not inevitable.
On the other hand, I have every confidence that an LLM-based test suite would introduce more flakiness and uncertainty than it could rid me of.
Re: Show HN: Stagehand – an open source browser automation framework powered by AI
#59Earlier quoted context omitted.
>Personally I'd love to use this as an intermediate workflow for producing deterministic playwright code, but it looks like this is intended for running directly. Treating UI test code as some kind of static source of truth is the biggest nightmare in all of UI front end development. Web UIs naturally have a ton of "jank" that accumulates over time, which leads to a ton of false negatives; slow API calls, random usag…
> Treating UI test code as some kind of static source of truth is the biggest nightmare in all of UI front end development. Web UIs naturally have a ton of "jank" that accumulates over time, which leads to a ton of false negatives; slow API calls, random usages of websockets/SEE, invisible elements, non-idempotent endpoints, etc. etc. And having to write "deterministic" test code for those is the single biggest reaso…
And no one ever does. There is zero incentive to spend days wrangling with a flakey UI test throwing a false positive for your new feature, and so the test gets skipped and everyone moves on and forgets about it. I have literally never seen a project where UI tests were continually added to and maintained after the initial build out, simply because it is an immense time sink with no visible or perceived value to product, business, or users, and requires tons of manual maintenance to keep in sync with the application.
Re: Show HN: Stagehand – an open source browser automation framework powered by AI
#60Hey Anirudh, Stagehand looks awesome, congrats. Really love the focus on making browser automations more resilient to DOM changes. The act, extract, and observe methods are super clean. You might want to check out Lightpanda ( https://github.com/lightpanda-io/browser ). It's an open-source, lightweight headless browser built from scratch for AI and web automation. It's focused on skipping graphical rendering to make…
The web isn't made for agents and automation. It's made for people.