AI & agentic testing

ChatGPT, Claude and Copilot for Test Automation (2026): What Works and What Doesn't

Waseem AhmadWaseem Ahmad 9 min read
A close up of a computer screen with a menu on it — Using ChatGPT for Test Automation

A tester pastes a user story into ChatGPT and asks for test cases. Thirty seconds later there are 25 neat scenarios and a Playwright script. The script fails on its first run: the button it clicks doesn't exist, because the model guessed the selector.

That's the pattern with general-purpose AI assistants in testing. They're very good at thinking and writing, and much weaker at knowing your app. This guide shows where they help, which prompts work, and where you need something that actually runs and maintains tests.

ChatGPT, Claude and Copilot are useful for test automation as fast drafting partners: test case design, boundary values, test data, API test skeletons and bug reports. They don't see your running app unless you give it to them, so generated selectors are often wrong. Running and maintaining tests still needs a framework, a coding agent or an AI QA platform.

Key takeaways

  • Use chat assistants for thinking work: test ideas, edge cases, data and clear bug reports. They're fast and usually good.
  • Generated UI code is only as good as the page context you give it. Paste the real HTML or accessibility tree, or expect invented selectors.
  • Coding agents such as Claude Code and Copilot in VS Code can run your tests and fix them, and MCP lets them drive a real browser.
  • A chat window doesn't give you scheduled runs, self-healing, video evidence or a regression history. That's where a dedicated platform fits.

What are ChatGPT, Claude and Copilot actually good at in testing?

They're good at turning vague requirements into structured test ideas, and at writing repetitive code you'd otherwise type by hand. They're weakest where the answer depends on facts only your app knows.

TaskChat assistant (ChatGPT, Claude)Coding agent (Claude Code, Copilot in VS Code, Cursor)Dedicated AI QA platform
Test case design from a storyStrongStrong, with repo contextStrong, often from Jira directly
Boundary values and test dataStrongStrongVaries
UI test codeWeak without page contextGood: can open the page or read the codeNot needed (tests are steps)
Running testsNo, not in your environmentYes, runs commands locallyYes, in the cloud and CI
Fixing tests after UI changesOnly if you paste the new pageYes, re-runs and patches codeSelf-healing, logged for review
Evidence for a release decisionNoTerminal output and code diffsVideo, traces, history and trends

Read the table as a division of labour. Most teams that get value from AI testing use more than one column.

Which prompts work for test case design?

The best prompts give the model a role, the requirement, the constraints and the output format. Vague prompts produce generic happy-path tests.

You are a senior QA engineer. Design test cases for this user story.

Story: As a returning customer, I can apply one discount code at checkout.
Rules: codes are case-insensitive; one code per order; expired codes show
"This code has expired"; codes can't reduce the total below $0.

Return a table with: ID, title, preconditions, steps, expected result,
type (positive / negative / boundary). Include at least 4 negative and
3 boundary cases. Flag any rule that is ambiguous instead of guessing.

Three details make this work. Listing the rules stops the model inventing business logic. Asking for a minimum number of negative cases counters its bias toward happy paths. Asking it to flag ambiguity turns a weakness into a requirements review.

Follow up with "What did you miss?" or "Which of these would a payments specialist add?" A second pass usually surfaces concurrency, localisation and permission cases.

How do you get usable Playwright or Selenium code from an LLM?

Give it the real page. A model asked to "write a Playwright test for our login page" has to guess every locator. A model given the page's HTML, or better its accessibility tree, can choose locators that exist.

Write a Playwright Test (TypeScript) for the flow below.
Use getByRole / getByLabel locators only. No CSS or XPath.
No fixed waits (no waitForTimeout). Use web-first assertions.
If an element isn't in the snapshot I pasted, say so instead of inventing it.

Flow: log in as standard user, open Orders, filter by "Shipped",
assert at least one row shows status "Shipped".

[paste accessibility snapshot or HTML here]

Asking for role-based locators matters. Playwright's own docs recommend user-facing locators such as getByRole because they track what users see rather than DOM structure. They also explain that locators are the centre of Playwright's auto-waiting, which is why banning fixed sleeps is safe.

For Selenium, ask for explicit waits, a page object per screen and locators by ID, name or accessible text. Then review the code as you would a junior engineer's pull request: check every assertion actually tests the requirement, not just that a page loaded.

Can ChatGPT or Claude generate test data?

Yes, and it's one of the safest uses because nothing sensitive needs to go in. Ask for synthetic data with the edge cases spelled out.

Generate 30 rows of synthetic customer data as CSV with columns:
first_name, last_name, email, country, postcode, date_of_birth.
Include: names with apostrophes and accents, a 60-character surname,
an email with a plus sign, UK and US postcodes in valid and invalid
formats, a customer who turns 18 today, and one empty optional field.
Use obviously fake domains such as example.com.

For larger volumes, ask the model to write a generator script with a library such as Faker instead of producing rows directly. Scripts are repeatable, and you can seed them so every run gets the same data.

Never paste real customer records to "make the data realistic". Describe the shape of the data instead.

How do you use an LLM for API tests?

Paste the OpenAPI definition for one endpoint, not the whole spec, and ask for a test plan before any code.

Here is the OpenAPI definition for POST /orders.
1. List the tests you would write: happy path, validation errors,
   auth failures, idempotency, and boundary values for each field.
2. Then write them in pytest with requests, one test per case,
   reading the base URL and token from environment variables.
Do not hard-code credentials.

Models are good at enumerating status codes and field-level validation. They're poor at knowing your real business rules, such as whether a duplicate order should return 409 or 200. Mark those cases as questions for the developer.

Can AI write better bug reports?

It can make a rough report clear. Paste your notes, the steps, the console errors and the environment, then ask for a report with a one-line summary, numbered steps, expected and actual results, severity reasoning and a list of what you haven't checked yet.

Keep the facts yours. The model shouldn't add steps you didn't take or guess the root cause. Our guide to writing a great bug report has a template you can paste into the prompt.

Where do chat assistants fall short for test automation?

These limits apply to any general-purpose chat assistant, whichever model is underneath.

  • Hallucinated selectors and APIs. Without the real page or code, the model invents plausible IDs, routes and helper functions. The code looks right and fails at runtime.
  • No execution. A normal chat doesn't run your suite against your staging environment, in your CI, with your data. You copy, paste, run and report back.
  • No maintenance. When the UI changes next sprint, nothing tells the chat. Someone has to notice the failures and start a new conversation.
  • Weak assertions. Generated tests often check that a page loaded, not that the total is correct. Review every expected result.
  • Inconsistent output. Ask twice and you may get two different suites. Save prompts and outputs that worked.
  • Data privacy. Check your plan's terms before pasting code, logs or screenshots. OpenAI says it doesn't train on data from ChatGPT Business, Enterprise or its API by default, and Anthropic says it doesn't train on inputs or outputs from its commercial products by default. Consumer plans work differently, so use your company's approved account.

Where do coding agents and MCP fit?

Coding agents close the gap between "writes code" and "runs code". They work inside your repository and terminal, so they can see your page objects, run the tests and fix what fails.

The Model Context Protocol (MCP) lets these agents use external tools. Playwright MCP gives an agent a real browser and works from the page's accessibility tree rather than screenshots, which fixes the hallucinated-selector problem at the source. It lists Claude Code, Cursor, VS Code and Copilot among its supported clients. Our Playwright MCP guide covers setup and prompts.

Playwright also ships Test Agents: a planner that explores your app and writes a test plan, a generator that turns the plan into test files, and a healer that re-runs failing tests and proposes fixes. They can be set up for VS Code, Claude Code, Codex or opencode.

One caution: if the same agent writes the feature and its tests, both can share the same misunderstanding. Our playbook on testing AI-generated code explains how to keep an independent check in the loop.

When is a dedicated AI QA platform the better fit?

Coding agents suit engineers who want tests as code in the repo. A dedicated AI QA platform suits teams where testers, not engineers, own regression, and where the business wants evidence, not terminal output.

You needBetter fit
Quick test ideas, data and bug reportsChat assistant
Engineers writing and fixing Playwright tests in the repoCoding agent plus Playwright MCP or Test Agents
Testers building and maintaining a regression suite without codeAI QA platform
Scheduled runs, parallel cloud execution and CI gatesAI QA platform, or a framework plus your own infrastructure
Video, traces and pass-rate history for release sign-offAI QA platform
Testing chatbots, voice agents or IVRA platform built for agent-to-agent testing

Where does Robonito fit, and where doesn't it?

Robonito is an agentic QA platform: AI agents create, run and maintain end-to-end tests. In AI Studio you describe what to test, paste a URL or reference a Jira issue, and the agent works through the live app step by step, so locators come from the real page rather than a guess. It can also generate tests from requirement documents, Jira stories and epics, and Swagger/OpenAPI definitions.

Runs execute in parallel in isolated cloud workers. Every run keeps video, network traces and an AI root cause for failures, plus pass rates and trends across runs. When the UI changes, self-healing adapts steps and logs healed steps for review. It plugs into Jenkins, GitHub Actions, GitLab CI and Azure DevOps on Starter and above.

If you want code, Robonito can generate executable code for your test cases. On Pro, its agents also test chatbots, voice agents and IVR systems.

Where it doesn't fit as well:

  • If your engineers want every test as hand-written code in Git, a coding agent plus Playwright is the more natural workflow.
  • Free and Starter are web-only. Mobile, desktop and API testing need Pro or Enterprise.
  • CI/CD, Jira and Slack integration start on Starter, not Free.

Plain text to test case & Autopilot is on every plan, including the free one. with a story you'd normally paste into ChatGPT, or to see the AI QA agent run it end to end.

What does a practical AI-assisted testing workflow look like?

  1. Design with a chat assistant. Turn each story into test cases, edge cases and data. Have a tester review them.
  2. Decide where each test lives. Unit and API tests go in the repo. User journeys go in your end-to-end suite.
  3. Generate code with page context. Use a coding agent with Playwright MCP, or paste the real accessibility snapshot.
  4. Run everything in CI. A test that only ran once on a laptop isn't regression coverage.
  5. Review changes to tests like code. That includes AI fixes and self-healed steps.
  6. Keep prompts that work. A shared prompt library makes output consistent across the team.

Frequently asked questions

Can ChatGPT write automated tests?

Yes. ChatGPT can write Playwright, Selenium, Cypress and API test code, and it's good at test case design and test data. The catch is context: without your real page or code it guesses selectors and helper names. Paste the HTML or accessibility tree, ask for role-based locators, and review every assertion before you trust the test.

Is ChatGPT or Claude better for test automation?

Both are capable for test design, data and code. The bigger difference is the tool around the model. Claude Code works inside your repo and terminal and can run tests, while Copilot in VS Code does the same in the editor. Pick the tool that fits where your tests live, and compare outputs on your own prompts.

Can GitHub Copilot generate unit tests?

Yes. GitHub's documentation lists generating unit tests among the tasks Copilot Chat can do. In agent mode in VS Code, Copilot can also run commands such as your test suite and iterate on failures. As with any generated test, check that assertions test behaviour, not just that code runs without throwing.

Is it safe to paste code into ChatGPT or Claude?

It depends on your plan and your company's policy. OpenAI and Anthropic both say they don't train on business or API data by default, but consumer plans have different settings. Use your company's approved account, strip secrets and personal data from logs, and never paste real customer records.

Will AI assistants replace test automation tools?

Not on their own. Chat assistants draft tests; they don't schedule runs, keep evidence or maintain a suite. Coding agents can run and fix tests, but someone still owns the framework, infrastructure and CI. Dedicated AI QA platforms handle execution, self-healing and reporting. Most teams combine all three.


Ready to go from a ChatGPT prompt to a test that runs every night? or .

Free whitepaperThe Agentic QA PlaybookMove from test scripts to AI agents in 90 days, with the controls, metrics and a 25-question vendor checklist.

No-code AI test automation

Spend less time testing and more time shipping.

3Pillar showed Robonito's agents to its own client live, and that client is now onboarding. Start on the Free plan, which stays free forever, or book a demo and we'll walk through your own app.

Newsletter

Get new posts by email

Practical guides on software testing, QA automation and AI agents. One email when we publish, no spam.

We'll send a confirmation email first. Your details are stored with Mailchimp, our email provider.

All blog posts