FR EN
AI and Machine Learning for Automated Testing
AI and Machine Learning for Automated Testing — AutomationDataCamp
April 25, 2026 · Updated September 29, 2026 8 min read

AI and Machine Learning for Automated Testing

AI is used in test automation today for five main jobs: generating test ideas and test code with large language models (LLMs), repairing broken locators ("self-healing"), comparing screens visually, choosing which tests to run for a given change, and spotting anomalies in results and logs.

None of these removes the need for a tester: AI produces drafts and suggestions that a person with test design skills must review. This guide explains how each technique works, which tools implement it, and where its limits are.

Key takeaways
  • LLMs (GitHub Copilot, ChatGPT, Claude, Gemini) write useful first drafts of test cases and Playwright or Cypress code, but invent selectors and write weak assertions if nobody checks
  • Self-healing (Testim, mabl, Healenium for Selenium) keeps tests running after UI changes, at the risk of hiding real bugs
  • Visual AI (Applitools Eyes) compares screens like a human would, instead of pixel by pixel
  • Predictive test selection uses change history to run the tests most likely to fail first
  • Humans stay in charge of strategy, risk, test design and the final verdict

How is AI used in test automation today?

AI is mainly used to speed up tasks around the tests rather than to decide what quality means. The table below summarises the main techniques.

TechniqueWhat it doesExample toolsMain risk
LLM test generationDrafts test cases and test code from requirements or pagesGitHub Copilot, ChatGPT, Claude, Gemini, Playwright MCPInvented selectors or APIs, shallow assertions
Self-healing locatorsFinds the new element when a locator breaksTestim, mabl, HealeniumSilently "heals" onto the wrong element
Visual AIDetects meaningful visual differences between runsApplitools EyesBaselines approved without review
Predictive test selectionRuns the tests most likely to fail for a changeLaunchable, Develocity Predictive Test SelectionSkipped tests that would have caught a bug
Anomaly detectionFlags unusual results, logs or metricsIsolation Forest and similar models, observability platformsFalse alarms that teams learn to ignore

Can AI write automated tests?

Yes, as drafts. Given a user story, an API specification or the HTML of a page, an LLM can propose test cases, including edge cases a tired human might skip, and generate Playwright, Cypress or pytest code. Coding assistants such as GitHub Copilot do this inside the IDE, and the open-source Playwright MCP server lets an AI agent drive a real browser through Playwright, reading the page's accessibility tree instead of guessing its structure.

The output still needs review. Generated tests often use selectors that do not exist, assert only that a page loaded, or encode the current behaviour, bugs included, as the expected result. Treat AI-written tests like code from a new colleague: run them, read them and check that each assertion would fail if the feature broke. Playwright's codegen, which records your clicks into code, is a useful non-AI alternative for the first draft.

What are self-healing tests, and do they work?

Self-healing tests recover automatically when a locator stops matching, by using other attributes of the element (text, position, neighbours, history) to find its most likely replacement. Commercial platforms such as Testim and mabl use machine learning models for this, and Healenium brings the idea to Selenium as an open-source library.

They work well against cosmetic changes such as a renamed class or a moved button, and reduce maintenance. The danger is that a test heals onto the wrong element and passes when it should fail. Review every healed locator and update the source, and prefer stable locators in the first place: roles, labels and test IDs, as described in our test automation best practices.

How does visual AI testing differ from screenshot comparison?

Classic screenshot comparison flags any pixel that changed, within a tolerance, which is what Playwright's toHaveScreenshot() does. Visual AI tools such as Applitools Eyes use computer vision to ignore rendering noise like anti-aliasing and to group differences by what a person would notice: a missing button, overlapping text or a shifted layout. Both need a human to approve the baseline; a wrong baseline makes every later run "pass" on a bug.

Can machine learning choose which tests to run?

Yes. Predictive test selection trains a model on the history of code changes and test results to estimate which tests are most likely to fail for a new change, then runs those first or runs only a subset on each commit. Launchable and Develocity offer this commercially, and Meta has published research on the approach.

It shortens feedback on large suites, but the full suite must still run regularly, for example nightly, to catch what the model misses. Our guide to automation in CI/CD shows where this fits in a pipeline.

How is machine learning used to detect anomalies?

Unsupervised models such as Isolation Forest learn what "normal" looks like in response times, error logs or data distributions, and flag outliers without a fixed threshold. This is useful in performance testing and for data-heavy applications, where a subtle shift matters more than a single failed assertion. Rules on the data remain the first line of defence; see our guide to data quality testing.

What are the risks of using AI in testing?

The main risks are over-trust, confidentiality and non-determinism.

  1. Over-trust: generated or healed tests that pass without really checking anything.
  2. Confidentiality: pasting proprietary code, credentials or customer data into a public AI service; use approved tools and anonymised data.
  3. Non-determinism: the same prompt can give different tests on different days, so the generated code must be versioned and reviewed like any other.
  4. Testing AI features themselves: chatbots and models need specific approaches, such as evaluation data sets, bias checks and, in the EU, attention to the AI Act.

Will AI replace QA testers?

No, but it changes the job. AI takes over part of the repetitive writing and maintenance; testers spend more time on risk analysis, test design, reviewing AI output and testing AI-based features. Understanding business context, deciding what matters, investigating complex failures and communicating with product and development teams remain human work. Testers who combine solid fundamentals with AI tools become more productive; those who rely on AI without fundamentals cannot tell a good generated test from a useless one.

Frequently asked questions

Which AI tools are used for test automation?

Common examples are GitHub Copilot and chat assistants such as ChatGPT, Claude or Gemini for writing tests, Playwright MCP for AI agents that drive a browser, Testim, mabl and Healenium for self-healing, Applitools Eyes for visual AI, and Launchable for predictive test selection.

Can ChatGPT write Playwright tests?

It can write a useful first draft, but it often invents selectors and writes weak assertions. Run the test, check each locator against the real page, and make sure every assertion would fail if the feature broke.

Are self-healing tests reliable?

They reduce maintenance for cosmetic UI changes, but a test can heal onto the wrong element and pass when it should fail. Review healed locators and keep stable locators such as roles, labels and test IDs.

Will AI replace software testers?

No. AI automates part of test writing and maintenance, but test strategy, risk analysis, test design and the final judgement on quality remain human responsibilities.

Is there a certification for AI in software testing?

Yes. ISTQB offers the Certified Tester Testing with Generative AI (CT-GenAI) certification, which covers using generative AI in test activities and its risks.

Learn to test with AI

The flagship programme of AutomationDataCamp (ADC), QA Automation & AI Tester (399 h over 12 weeks, 100% online, taught in English or French, no technical prerequisites), teaches Playwright with TypeScript and how to bring generative AI into testing. It includes the ISTQB CTFL v4.0 and ISTQB CT-GenAI v1.1 exams.

View the programme View the 3-month tracks

Related reading: How to test an LLM chatbot or a RAG app in 2026 · AI in software testing in 2026: five changes that are actually shipping.

Related articles