If you let an agent write code without seeing the result, it's guessing. Back pressure matters — the agent needs to see what it built, verify it works, catch what's off. Same idea as TDD: don't trust the output, check it.
So I wanted my agent to take screenshots of the UI5 app it was building in SAP Business Application Studio. Simple ask. Except BAS runs inside a Kubernetes container with no display server, no Chrome, and missing system libraries. Puppeteer fails. Playwright fails.
If you've worked in the SAP world, you know the feeling. Half the battle is figuring out what the platform even lets you do.
I spent way too long trying to make Puppeteer work before accepting the obvious. Sometimes the answer isn't "try harder," it's "wrong tool."
The answer is wdi5 — a WebdriverIO plugin built for UI5 apps — combined with a BAS plugin most people don't know about: the Headless Testing Framework.
Enable the plugin first
- Go to SAP BTP Cockpit → your subaccount → Business Application Studio
- Stop your dev space
- Edit → Additional SAP Extensions → check "Headless Testing Framework"
- Save and restart
This installs Firefox ESR and geckodriver into the container. That's your browser runtime. The only one you get.
Four steps. A checkbox. That's what stood between me and a working screenshot pipeline.
Project setup
Once the plugin is active:
npm init wdi5@latest
That scaffolds the config, test directory, and an npm script. Screenshots are one line:
await browser.saveScreenshot("./screenshots/01-home-page.png");
Now your agent can take screenshots inside BAS. It writes code, runs the tests, sees the result. Actual back pressure.
Next step: wrapping this into a Claude Code skill so the agent triggers it on its own. But that's a different post.