AI-assisted testing

Can ChatGPT be used to write automated tests?

Yes, ChatGPT or another language model can speed up the preparation of automated tests. A description of the scenario alone, however, is usually not enough to produce a reliable result. The model needs current application context, project rules and review by a person who understands the product’s risks.

What is the problem?

A model given only a written description does not know the current structure of your application. It may therefore propose selectors—the rules a test uses to find a field or button—based on common patterns rather than the actual page.

The result may look convincing and still fail to work. The password field may have a different name, or the selector may point to the wrong element. An even greater risk is a test that passes without checking the result that matters to the user.

Unsuitable selectors are a common cause of unstable tests. If a suite repeatedly reports failures without a clear cause, the team gradually stops trusting it.

How we address it

Where it is appropriate for the scenario and has been approved as safe, we give the model restricted access to a test environment. Through Playwright MCP, it can work with the current structure of the page. The draft is then based on elements the tool found in that particular state, not only on a written description.

A tester then reviews the draft. They verify that the scenario protects an important user journey, contains the correct expectations and can fail when the application behaves incorrectly. They pay particular attention to the risk of a test that passes without a useful assertion.

The output can be standard Playwright code in your repository. Before adding it to the suite, we run it repeatedly and check its test data and integration with the existing process.

What to watch out for

A language model can produce inaccurate code even when it has good context. Production data, passwords and internal secrets also do not belong in a chat unless an approved security regime is in place and the relevant data-processing settings have been verified. Use AI as an assistant during test creation, not as an automatic approval mechanism.

What you gain

Next step

Choose one important, well-understood scenario and compare both the time required and the quality of the result with your usual approach. If you would like to prepare such a pilot, the next step can be a no-obligation consultation.

Related topics

You might also be interested in

AI will speed up work. The person is responsible for the result.

AI speeds up the design, creation, repair and migration of web, Android, API and Electron tests; a specialist verifies every output before use.