Generative AI vs Agentic AI
AI is rapidly changing software testing, but there is an important difference between simply asking AI to generate a Playwright test and allowing an AI agent to actually plan, execute, observe, and validate a testing workflow.
A traditional Generative AI interaction might look like this:
SDET:
"Generate Playwright test cases for the Login page."
↓
Generative AI
↓
Playwright Test CodeThe AI generates something and stops. Agentic AI takes this much further:
SDET:
"Test the Login feature and report any defects."
↓
AI Testing Agent
↓
Understand Requirements
↓
Create Test Plan
↓
Open Application
↓
Execute Tests
↓
Observe Results
↓
Analyze Failures
↓
Collect Evidence
↓
PASS / FAIL
↓
Defect ReportThe AI is no longer only generating content. It is working toward a testing goal. In this tutorial, we will understand how this architecture works and how technologies such as GitHub Copilot Custom Agents, Model Context Protocol (MCP), Playwright MCP, and Playwright can be combined to build an Agentic AI testing workflow.
What Is Generative AI in Software Testing?
Generative AI, or GenAI, is AI primarily used to generate new content based on instructions and context. For an SDET, Generative AI can help generate:
- Test cases
- Playwright automation code
- API tests
- SQL queries
- Test data
- Page Objects
- Assertions
- Test documentation
- Bug reports
- Test summaries
- Failure explanations
For example, suppose we have the following acceptance criteria:
AC1: A valid user should be able to log in.
AC2: An invalid password should display an error.
AC3: Username is required.
AC4: Password is required.We could ask GitHub Copilot:
Generate Playwright TypeScript tests
for these acceptance criteria.
Use Page Object Model.
Include positive and negative scenarios.Copilot might generate:
test('valid user can login', async ({ page }) => {
await page.goto('/login');
await page.getByLabel('Username').fill('testuser');
await page.getByLabel('Password').fill('password123');
await page.getByRole('button', { name: 'Login' }).click();
await expect(page).toHaveURL(/dashboard/);
});This is extremely useful. However, notice what happened:
Received Prompt
↓
Generated Code
↓
StoppedIt did not necessarily open the real application. It did not independently inspect the UI. It did not decide what action should happen next based on what the application returned. This is primarily Generative AI-assisted test automation.
What Is Agentic AI?
Agentic AI extends AI systems with capabilities such as:
- Reasoning
- Planning
- Tool usage
- Context
- Goal-oriented execution
- Observation
- Decision making
- Iterative feedback loops
- Controlled autonomy
Instead of asking for generated tests, we might give the AI a goal:
Test the Login feature.
Use the acceptance criteria.
Execute the tests against the application.
Investigate failures.
Report any defects.Now the AI might reason:
Goal: Verify Login feature.
↓
What requirements apply?
↓
What scenarios should I test?
↓
What does the Login page look like?
↓
Which field is Username?
↓
Which field is Password?
↓
What should happen after Login?
↓
Execute action
↓
Observe result
↓
Did expected behavior occur?
↓
YES → PASS
NO → InvestigateThis produces the fundamental agentic loop:
GOAL
↓
PLAN
↓
ACT
↓
OBSERVE
↓
REASON
↓
DECIDE
↓
ACT AGAIN
↓
VERIFY
↓
COMPLETEGenerative AI vs Agentic AI for Testing
Consider the same Login feature.
Generative AI Approach
Prompt: "Write 10 Playwright test cases for the Login page."
Requirement
↓
Prompt
↓
Generative AI
↓
Generated Tests
↓
STOPThe SDET remains responsible for executing and interpreting the tests.
Agentic AI Approach
Prompt: "Test the Login feature and report any defects."
Requirement
↓
AI Agent
↓
Analyze Acceptance Criteria
↓
Create Test Scenarios
↓
Open Application
↓
Inspect Login Page
↓
Execute Scenario
↓
Observe Application
↓
Compare Expected vs Actual
↓
PASS / FAIL
↓
Investigate Failure
↓
Create Test ReportThat is a fundamentally different level of automation.
The Building Blocks of an AI Testing Agent
An AI agent usually needs several components:
AI AGENT
┌──────────────────┐
│ LLM / Reasoning │
├──────────────────┤
│ Goal │
├──────────────────┤
│ Instructions │
├──────────────────┤
│ Context │
├──────────────────┤
│ Planning │
├──────────────────┤
│ Tools │
├──────────────────┤
│ Observations │
├──────────────────┤
│ Decision Loop │
└──────────────────┘The LLM provides reasoning. The goal tells the agent what needs to be achieved. Instructions define how the agent should behave. Tools allow the agent to interact with external systems. For SDET workflows, those tools might include:
Playwright
REST APIs
Databases
GitHub
Jira
AWS
Logs
CI/CD
File systemThis raises an important question: how does an AI agent communicate with all these tools? One increasingly important answer is MCP.
What Is MCP?
MCP stands for Model Context Protocol. MCP provides a standardized way for AI applications and agents to connect with external tools and systems.
Think about USB. Before standardized interfaces, every device could require its own proprietary connection. USB created a common interface. MCP plays a similar conceptual role for AI tools. Instead of building custom integrations like:
AI → Custom Playwright Integration
AI → Custom Database Integration
AI → Custom GitHub Integration
AI → Custom Jira Integrationwe can move toward:
AI Agent
│
MCP
│
┌───────────┼───────────┐
↓ ↓ ↓
Playwright GitHub Database
MCP MCP MCPMCP does not itself perform browser automation. It provides the standardized connection through which the AI can access tools.
AI Agent vs MCP vs Playwright
This distinction is extremely important.
AI Agent — the Brain
The AI Agent decides: "What should I do? What should I test? What happened? What should I do next?"
MCP — the Connection Layer
MCP tells the AI: "These tools are available. Here is how you call them. Here is the result."
Playwright — the Hands
Playwright is the browser automation engine. It performs actions such as navigate, click, fill, type, select, upload, inspect, and assert.
The complete mental model is:
AI AGENT = BRAIN
↓
MCP = CONNECTION
↓
PLAYWRIGHT = HANDS
↓
APPLICATION = REAL WORLDWhat Is Playwright MCP?
Playwright MCP is an MCP server that exposes browser automation capabilities to AI clients and agents. The official Playwright documentation describes it as a way for LLMs to interact with web pages using structured accessibility snapshots through MCP.
One particularly useful feature is that Playwright MCP can represent the page as structured information rather than requiring the AI to visually guess where an element is. For example, the agent might receive a snapshot similar to:
heading "todos"
textbox "What needs to be done?" ref=e5
listitem:
checkbox "Toggle Todo" ref=e10
link "Active" ref=e21
link "Completed" ref=e22The AI can understand that e5 is the Todo textbox, e10 is the checkbox, and e21/e22 are the filters. It can then interact with those references:
browser_type
ref=e5
text="Learn Agentic Testing"Playwright MCP officially uses these accessibility snapshots and references for interaction. This allows the model to work from semantic page structure rather than relying entirely on pixels.
Installing Playwright MCP
Current Playwright MCP documentation requires Node.js 20 or newer. Check Node:
node --versionThen an MCP client can configure Playwright MCP with:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}For a local VS Code project, a testing-oriented setup could use:
{
"servers": {
"playwright": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@playwright/mcp@latest", "--isolated"]
}
}
}The --isolated option is useful for testing because it avoids unintentionally depending on a persistent browser profile.
Where Does GitHub Copilot Fit?
This is where the architecture becomes particularly useful for SDETs. Instead of writing our own agent application, GitHub Copilot can provide the AI agent environment. Our architecture becomes:
GitHub Copilot
↓
Custom SDET Agent
↓
MCP
↓
Playwright MCP
↓
Playwright
↓
Browser
↓
ApplicationGitHub Copilot currently supports custom agents that can be tailored with specialized instructions, tools, and MCP access. This means we can create an AI agent specifically designed to behave like an SDET.
Do We Need Custom Agent .md Files for Generative AI?
No. This is an important distinction. You do not need to create custom agent files simply to use Generative AI for testing. For example, these tasks don't inherently require a custom agent:
- Generate Playwright tests
- Generate test cases
- Generate test data
- Explain a test failure
- Generate API tests
- Create SQL validation queries
- Review automation code
You can simply ask Copilot:
Read requirements/login.md.
Generate Playwright tests covering:
- valid login
- invalid password
- missing username
- missing password
- locked user
Use TypeScript and Page Object Model.That is perfectly valid AI-assisted test automation.
When Should We Create Custom Agent Files?
Custom agent profiles become useful when you want a reusable specialized AI role. GitHub currently supports repository-level custom agents under .github/agents/:
.github/
└── agents/
├── qa-orchestrator.agent.md
├── requirement-analyst.agent.md
├── test-planner.agent.md
├── test-executor.agent.md
└── defect-analyst.agent.mdGitHub describes custom agents as specialized versions of Copilot with their own instructions and tool access. Agent profiles are Markdown files with YAML frontmatter. For example:
---
name: Test Planner
description: Creates enterprise test scenarios from acceptance criteria
---
You are a Senior SDET Test Designer.
Whenever you receive acceptance criteria:
1. Analyze every acceptance criterion.
2. Identify positive scenarios.
3. Identify negative scenarios.
4. Identify boundary cases.
5. Identify state transitions.
6. Identify API validation opportunities.
7. Identify database validation opportunities.
8. Identify requirement gaps.
9. Assign risk.
10. Assign test priority.Instead of explaining those expectations repeatedly, the custom agent permanently represents that specialized role for the repository.
Custom Instructions vs Prompt Files vs Custom Agents
This distinction is useful when designing a professional Copilot-enabled test framework. GitHub provides several customization mechanisms.
Custom Instructions
Example: .github/copilot-instructions.md. Use these for repository-wide standards:
Always use TypeScript.
Prefer getByRole() and getByLabel().
Never use page.waitForTimeout().
Use web-first assertions.
Use Page Object Model.
Never hardcode credentials.Think: rules everyone should follow.
Prompt Files
Prompt files represent reusable tasks: generate API regression tests, analyze a requirement, create a Page Object, review test architecture. Think: a reusable request.
Custom Agents
Custom agents represent specialized workers: Requirement Analyst, Test Planner, Test Executor, Defect Analyst. Think: a reusable specialist.
Building an Agentic Testing Architecture
Let's design a simple enterprise-style architecture:
QA ORCHESTRATOR
│
┌────────────────┼────────────────┐
▼ ▼ ▼
Requirement Test Planner Risk
Analyst Agent Analyst
│ │ │
└────────────────┼────────────────┘
▼
Test Executor
│ MCP
▼
Playwright MCP
│
▼
Browser
│
▼
Application
│
PASS / FAIL
│
▼
Defect Analyst
│
▼
Regression Engineer
│
▼
Playwright Tests
│
▼
CI/CDRequirement Analyst Agent
The Requirement Analyst receives the acceptance criteria and might produce:
Positive Scenarios
TC-001: Valid user login
Negative Scenarios
TC-002: Invalid password
TC-003: Missing username
TC-004: Missing password
Potential Boundary Scenarios
TC-005: Whitespace username
TC-006: Very long username
Requirement Gaps
Locked-user behavior not specified.
Maximum password length not specified.Test Planner Agent
The Test Planner takes the requirement analysis and creates executable scenarios:
ID: TC-001
Title: Valid User Login
Acceptance Criteria: AC1
Preconditions: Active test user exists.
Test Data: Valid username/password.
Goal: Authenticate successfully.
Expected: User reaches dashboard.
Priority: Critical
Regression Candidate: YesNotice that the planner should generally avoid implementation details like clicking #loginButton or filling input:nth-child(2). The planner describes what should be tested; the executor determines how to execute it.
Test Executor Agent
The Test Executor receives the scenario and has access to playwright/* tools through MCP. Its workflow becomes:
Read Scenario
↓
Navigate to Application
↓
Inspect Page
↓
Find Username
↓
Find Password
↓
Enter Credentials
↓
Submit
↓
Inspect Result
↓
Compare Expected vs ActualThis is the core of Agentic Testing.
Example: Agentic TodoMVC Test
Suppose our application is https://demo.playwright.dev/todomvc and the requirement says a user can add a Todo and the new Todo appears in the list. We tell the agent:
Test the Todo creation functionality.
Create a Todo: "Learn Agentic Testing"
Verify that it appears.The agent decides it needs to open the application, and Playwright MCP performs navigation. Next the agent receives an accessibility snapshot containing the textbox with ref=e5. The agent reasons that e5 is the Todo input and enters the test data. Then it inspects the application again, and the snapshot now contains a listitem with the text 'Learn Agentic Testing'.
EXPECTED: Todo appears.
ACTUAL: 'Learn Agentic Testing' is visible.
STATUS: PASSThe important part is that the SDET didn't explicitly program every browser step. The agent discovered and executed the workflow toward the testing goal.
Why Observation Is So Important
Traditional automation generally follows predetermined instructions:
await page.goto('/login');
await username.fill(user);
await password.fill(password);
await loginButton.click();
await expect(dashboard).toBeVisible();The sequence is already defined. Agentic testing introduces a feedback loop:
ACTION
↓
OBSERVATION
↓
INTERPRETATION
↓
DECISION
↓
NEXT ACTIONFor example: the agent clicks Login, the application displays 'Account Locked', the agent observes the message, evaluates the requirement (expected: login succeeds; actual: account locked), and investigates. This ability to make decisions from observations is one of the major differences between traditional scripted automation and agentic workflows.
Defect Analyst Agent
A failed test does not automatically mean "application bug". A mature Quality Engineering architecture should classify failures:
FAILURE
│
┌────────────┼────────────┐
▼ ▼ ▼
Application Test Environment
Defect Issue Issue
│
▼
Requirement GapSuppose the expected result was "Invalid username or password." but the actual result was a 500 Internal Server Error. The Defect Analyst might generate:
Title: Login returns Internal Server Error for invalid credentials
Severity: High
Steps:
1. Open Login page.
2. Enter valid username.
3. Enter invalid password.
4. Click Login.
Expected: User-friendly authentication error.
Actual: 500 Internal Server Error.
Classification: Application DefectThis is more valuable than simply saying "Test Failed."
Multi-Agent Testing Architecture
One giant agent can perform everything, but separating responsibilities can produce cleaner architecture. Instead of one agent doing requirements, planning, testing, debugging, reporting, and code generation, we can create:
QA Manager Agent
│
├── Requirement Analyst
├── Test Planner
├── Test Executor
├── Defect Analyst
└── Regression EngineerGitHub currently supports custom-agent and sub-agent patterns where specialized agents can operate with their own prompts and scoped tools. This gives us an important architectural capability: least privilege. The Requirement Analyst might only need read and search tools. The Test Executor might need read, search, and playwright/*. The Regression Engineer might need read, edit, and execute. Not every AI agent needs access to every system.
Agentic Testing Should Not Replace Playwright Regression Tests
This is one of the most important architectural principles in this tutorial. It would be a mistake to conclude that AI agents can use the browser, so we don't need Playwright tests anymore. Traditional Playwright tests remain extremely valuable because they are:
- Deterministic
- Repeatable
- Fast
- Auditable
- Predictable
- CI-friendly
- Version controlled
test('user can add a todo', async ({ page }) => {
await page.goto('/');
const input = page.getByPlaceholder('What needs to be done?');
await input.fill('Learn Agentic Testing');
await input.press('Enter');
await expect(
page.getByText('Learn Agentic Testing')
).toBeVisible();
});This remains excellent automation. Agentic AI should complement it.
The Better Enterprise Pattern
A more powerful architecture is:
Agentic Exploration
↓
Discover Behavior
↓
Verify Requirement
↓
Find Defect
↓
Developer Fixes Defect
↓
Generate Regression Test
↓
Review
↓
Commit
↓
CI/CDImagine an AI agent discovers that a locked user attempting login receives 'Invalid credentials' instead of 'Account locked'. The defect is fixed, and then the Regression Engineer Agent generates:
test('locked user receives account locked message', async ({ page }) => {
await loginPage.login(lockedUser.username, lockedUser.password);
await expect(loginPage.errorMessage).toHaveText('Account locked');
});Now the discovered scenario becomes part of the permanent regression suite. This gives us AI exploration plus deterministic automation, rather than forcing us to choose one or the other.
Enterprise Agentic Quality Engineering Architecture
Now let's take the idea further. Imagine the following enterprise ecosystem:
JIRA STORY
│
▼
QA ORCHESTRATOR
│
┌───────────────────┼───────────────────┐
▼ ▼ ▼
Requirement Risk Analysis Test Planner
Agent Agent Agent
│ │ │
└───────────────────┼───────────────────┘
▼
Execution Agent
│
┌─────────────┼─────────────┐
▼ ▼ ▼
Playwright MCP REST API Database
│ │ │
└─────────────┼─────────────┘
▼
Validation Agent
│
PASS / FAIL
│
▼
Defect Analyst
│
▼
Jira / GitHub
│
▼
Regression Engineer
│
▼
GitHub PR
│
▼
CI/CDNow we have moved far beyond "AI writes test code". We are creating AI-enabled Quality Engineering workflows.
Example Enterprise Workflow
Suppose a Jira story says: "As a customer, I want to purchase a subscription so that I can access premium features," with acceptance criteria covering a successful purchase, a payment API transaction, a database subscription record, and a dashboard that displays the active subscription.
An enterprise Agentic Testing platform could perform:
Read Jira Story
↓
Analyze Acceptance Criteria
↓
Create UI/API/DB Scenarios
↓
Open Application
↓
Execute UI Workflow
↓
Capture Order ID
↓
Call Subscription API
↓
Validate API Response
↓
Query Database
↓
Validate Subscription Record
↓
Return to UI
↓
Verify Dashboard
↓
PASS / FAIL
↓
Investigate Failure
↓
Generate Quality ReportThat is where Agentic AI becomes especially interesting for Test Architects and Quality Engineering teams.
Security and Guardrails
Giving an AI agent tools means giving it real capabilities. Therefore enterprise implementations require guardrails:
You are an autonomous SDET.
SAFETY RULES:
- Only test approved applications.
- Never make real purchases.
- Never submit real financial transactions.
- Never delete production data.
- Never modify user permissions.
- Never expose credentials.
- Do not navigate outside approved domains.
- Ask for human approval before destructive actions.We can think about tool execution like this:
Agent wants action
↓
Risk Evaluation
┌────┴────┐
↓ ↓
Low Risk High Risk
↓ ↓
Execute Human Approval
↓
ExecuteThis becomes increasingly important as agents gain access to browsers, databases, GitHub, cloud environments, Jira, CI/CD, and production-like systems. GitHub also warns that configured MCP tools can be used autonomously by its cloud agent, which makes permission design and trusted MCP configuration important.
Generative AI Testing vs Agentic AI Testing
Here is the final comparison:
- Generate test cases — both
- Generate Playwright code — both
- Generate test data — both
- Analyze requirements — both
- Plan multi-step workflow — GenAI limited/manual; Agentic yes
- Use external tools — GenAI depends on integration; Agentic is a core capability
- Open browser — GenAI usually not by itself; Agentic yes, with tools
- Inspect application — GenAI usually not by itself; Agentic yes
- Execute tests — GenAI usually human/tool driven; Agentic can be autonomous
- Observe results — GenAI limited; Agentic yes
- Decide next action — GenAI limited; Agentic yes
- Adapt during execution — GenAI limited; Agentic yes
- Investigate failures — GenAI prompt-driven; Agentic workflow-driven
- Goal-oriented execution — GenAI no/limited; Agentic yes
The most useful mental model remains: Generative AI = "Create something for me." Agentic AI = "Achieve this goal for me."
Recommended Learning Path for SDETs
Do not try to build a 20-agent enterprise platform on day one. Build progressively.
Level 1 — Generative AI
Learn to use Copilot for requirements → generate test cases → generate Playwright tests.
Level 2 — Playwright MCP
Connect Copilot → MCP → Playwright MCP → Browser. Ask it to open TodoMVC, add 'Learn Agentic Testing', and verify the Todo appears. Understand the tool calls and observations.
Level 3 — Single SDET Agent
Create .github/agents/sdet-agent.agent.md and give it responsibilities for planning, execution, validation, and reporting.
Level 4 — Multi-Agent Testing
Split responsibilities: QA Orchestrator, Requirement Analyst, Test Planner, Test Executor, Defect Analyst, Regression Engineer.
Level 5 — Enterprise Quality Engineering
Integrate Jira, GitHub, Playwright, REST APIs, databases, AWS, CI/CD, reporting, and human approval.
The final architecture becomes:
Requirements
↓
AI Quality Orchestrator
↓
Risk + Test Planning
↓
UI + API + DB Execution
↓
AI Validation
↓
Failure Investigation
↓
Defect Management
↓
Regression Automation
↓
GitHub PR
↓
CI/CD
↓
Quality ReportFinal Takeaway
The biggest change AI brings to Quality Engineering is not simply faster test-code generation. The progression looks like this:
Traditional Automation — SDET writes everything
↓
Generative AI — AI helps create everything
↓
Agentic AI — AI helps execute the testing workflow toward a defined goalFor a modern SDET or Test Architect, the technology stack can be visualized as:
GitHub Copilot Agent = AI Brain
↓
Custom Agents = Specialized SDET Roles
↓
MCP = Standardized Tool Connection
↓
Playwright MCP = Browser Tool Provider
↓
Playwright = Automation Engine
↓
Browser = Execution EnvironmentAnd when we combine these pieces — GOAL, PLAN, ACT, OBSERVE, REASON, ADAPT, VERIFY, REPORT — we arrive at Agentic AI Testing.
The goal is not to replace Playwright, automation frameworks, or SDETs. The more practical direction is to combine AI reasoning, autonomous tool usage, deterministic automation, and human engineering judgment. That combination has the potential to move Quality Engineering from simply executing predefined scripts toward intelligent systems that can analyze requirements, explore applications, identify risks, execute tests, investigate failures, and continuously improve the permanent regression suite.
Get Playwright tutorials in your inbox
Weekly tips, real-world examples, and framework patterns – no spam, unsubscribe anytime.
Playwright Framework Series
View all →- 1Getting Started with Playwright: Installation, Setup, and Your First Test
- 2Playwright Locators: The Complete Guide with Real-World Examples
- 3Playwright Actions: Complete Guide to Click, Fill, Hover, Keyboard, Mouse & File Upload
- 4Playwright Assertions: The Complete Guide with Real-World Examples
- 5Playwright Auto Waiting: The Complete Guide with Real-World Examples
- 6Playwright Fixtures: The Complete Guide with Real-World Examples
- 7Playwright Browser Context & Multiple Tabs: The Complete Guide with Real-World Examples
- 8Playwright Authentication & Session Management: Complete Guide with Enterprise Examples
- 9Playwright Network Interception & API Mocking: Complete Guide with Real-World Examples
- 10Playwright Page Object Model (POM): The Complete Guide with Enterprise Examples
- 11Page Object Model with Playwright: A Practical Guide
- 12How to Build a Robust Professional Playwright Framework from Scratch (Step-by-Step)
- 13Building an Enterprise Playwright Framework from Scratch
API Testing Series
View all →- 1Playwright API Testing: The Complete Guide with Real-World Examples
- 2Part 1 : Playwright API Testing Tutorial: Build Enterprise-Level API Automation Framework
- 3Part 2: Playwright API Testing Tutorial: Setting Up Project & Sending Your First API Request
- 4Part 3: Mastering CRUD Operations in Playwright API Testing
- 5Part 4: Authentication in Playwright API Testing (Bearer Token, JWT, API Key & Reusable Fixtures)
- 6Part 5: Building an Enterprise-Level Playwright API Automation Framework
- 7Part 6: API Models, Schema Validation & Test Data Management in Playwright
- 8Part 7: Custom Fixtures, Hooks, Logging & Parallel Execution in Playwright API Testing
- 9Part 8: Building a Production-Ready Playwright API Framework (Environment Management, CI/CD, Reporting & Best Practices)
- 10Part 9: Advanced Playwright API Testing Techniques for Enterprise Automation
- 11Part 10: Building a Complete Enterprise Playwright API Automation Framework (Final Part)
- 12API Testing with Playwright: Request Context, Auth, and Assertions