Automated test case generation: 5 approaches compared

How automated test case generation works today, from requirements, models, user sessions, recorders and video, with the strengths and limits of each approach.

"Automated test case generation" means different things to different people. To some it means AI writing test cases from a user story. To others it means a recorder turning clicks into a script, or a tool mining real user sessions for flows to test.

They solve different problems. This guide compares the five main approaches, what each one is good at, and where each one falls short, so you can pick the right one for the job.

What makes a generated test case useful

Before comparing approaches, it helps to agree on what "good" means. A generated test case is only useful if it is:

  1. Correct. It describes what your app actually does, not what someone thinks it does.
  2. Executable. It can be run, ideally by a machine, without a person interpreting it.
  3. Stable. It passes when the app works and fails when it doesn't, run after run.
  4. Maintainable. When the UI changes on purpose, updating the test is quick.

Most approaches are strong on one or two of these and weak on the rest.

1. From requirements and user stories

How it works: you give an AI model a user story, acceptance criteria or a requirements document, and it writes test cases: happy paths, edge cases, negative cases.

Good at: coverage ideas. It's fast at listing the cases a person might forget, such as empty fields, long inputs and permission checks. It works before the feature is built.

Limits: the model has never seen your app. It guesses labels, page names and flows, so the output has to be checked against the real UI. And the result is a document; someone still has to run it or automate it.

Use it for: test planning and finding gaps.

2. Model-based generation

How it works: you describe the app as a model, typically states and transitions such as "signed out → sign in → dashboard", and a tool generates paths through it.

Good at: systematic coverage of complex workflows, especially where the order of actions matters.

Limits: someone has to build and maintain the model, which is a skill of its own. Generated paths still need concrete data and a way to execute them.

Use it for: complex, rule-heavy systems with dedicated test engineers.

3. From real user sessions

How it works: a script on your production site records how real users move through the app, and a tool turns common journeys into tests.

Good at: testing what users actually do, weighted by how often they do it.

Limits: it requires installing a tracking script in production, which raises privacy and security reviews. It only covers flows that already get traffic, so new features have nothing to learn from. And real user data has to be scrubbed before it becomes test data.

Use it for: mature products with lots of traffic and a team that can handle the data governance.

4. Record and playback

How it works: a browser plugin or recorder captures your clicks and keystrokes as you perform a flow, and saves them as a script.

Good at: speed. Recording a flow takes as long as performing it.

Limits: classic recorders captured page structure rather than meaning, so tests broke when layouts changed. Someone has to install the tool and record inside it, at the moment of testing. Modern recorders are better, as covered in record-and-playback testing: what changed, but the recording still has to be made in the tool.

Use it for: quick automation by people who are comfortable installing and learning a recorder.

5. From video

How it works: you upload a screen recording of a flow, from any recorder. AI reads the video and writes the test case: actions, values and an expected result. The steps are then played back in a real browser to prove they work.

Good at: correctness and reach. The input is the real app, so labels and flows aren't guessed. It works with videos teams already make, such as bug reports, walkthroughs and sign-off clips, and anyone who can record their screen can create a test.

Limits: it covers the flow shown in the video, so it won't invent edge cases for you; record those separately. The video needs to show one clear flow that ends on a visible result.

Use it for: automating the flows you already know matter, without code or a new tool to learn. This is the approach ReplayQA takes.

Side-by-side

Approach Input Knows the real UI Executable output Needs a new tool or script
Requirements Text No Usually not No
Model-based A model No With extra work Yes
User sessions Production traffic Yes Yes Yes, in production
Record and playback Live recording Yes Yes Yes, a recorder
Video Any screen recording Yes Yes No

Combining approaches

The approaches aren't exclusive. A practical setup for a small team:

  1. Use requirements-based generation to list what should be tested for a new feature.
  2. Record the important flows from that list, and automate them from video.
  3. Add a test from every fixed bug, so regressions can't return.
  4. Run the suite before every release.

Whatever you generate, check stability

The real test of any generated test case is the hundredth run, not the first. Prefer tools that prove a test before saving it, find elements by what users see rather than page structure, and repeat the same steps on every run. A test that behaves differently each time teaches the team to ignore red builds. Our guide to flaky end-to-end tests covers what to look for.