Skip to content
Philippos Melikidis

2026 · work project

Teaching an LLM where the buttons are

A crawler maps a web app so that AI-generated tests stop inventing selectors. A small pilot points that way, but is not significant yet.

Diagram. A crawler turns a web app into a graph of states and transitions with verified selectors. Requests that could change data are blocked. A generated test follows a path through the graph. In a pilot of 5 tasks, 4 of 21 selectors were invented without the graph and 0 of 12 with it, not significant at this size.Crawled graph · read-onlyStartListSearchDetailFormSavecould change data,blockedselector, verified on the real pagepath of one generated testInvented selectors · pilotwithout the graph4 / 21with the graph0 / 12Faithfulnessjudge model, scale 0 to 1without the graph: 0.12with the graph: 0.82Diagram. A crawler turns a web app into a graph of states and transitions with verified selectors. Requests that could change data are blocked. A generated test follows a path through the graph. In a pilot of 5 tasks, 4 of 21 selectors were invented without the graph and 0 of 12 with it, not significant at this size.Crawled graph · read-onlyStartListSearchDetailFormSavecould change data,blockedselector, verified on the real pagepath of one generated testInvented selectors · pilotwithout the graph4 / 21with the graph0 / 12Faithfulnessjudge model, scale 0 to 1without the graph: 0.12with the graph: 0.82
Schematic, not the measured site. One generated test in red

The problem

Ask a language model to write end-to-end tests for a web app and it will happily click on buttons that do not exist. It guesses selectors from what a page like this usually looks like, and the tests fail for reasons that have nothing to do with the app.

What I built

A crawler that walks through the app read-only, with every request that could change data blocked, and turns what it finds into a graph of states, transitions and selectors that were verified on the real page. The model only gets that graph as context when it writes tests. A dashboard shows the map, and a benchmark checks every generated selector against it.

What came out

0 / 12invented selectors with the graph, 4 of 21 without, pilot

Pilot on the company website (5 tasks, one run): invented selectors 0 of 12 with the graph vs. 4 of 21 without (Wilson 95 % CI 0 to 24 % vs. 8 to 40 %). Judge-rated faithfulness (GEval, 0 to 1) 0.82 vs. 0.12. Not significant at this size (Fisher p = 0.27).

Tech

  • Python
  • Playwright
  • Crawlee
  • FastAPI
  • LLMs via Ollama Cloud

Built at work. The code is not public, so no screenshots here.

← All work