Cegeka_Logo Careers Language Solutions Back
Solutions
Hybrid Cloud

Hybrid Cloud

Explore the added value of cloud adoption for your business.

Data solution

Data & AI

Discover our different data solutions to help you become a data-driven company.

RegulatoryCompliance_Visuals_Navigation (1)

Regulatory Compliance

Ensure GDPR & GxP compliance with our comprehensive solutions.

Cyber Security & Networking Solution

Cyber Security & Networking

With cyber resilience, your organisation becomes a bit more secure with each day.

Digital Workplace Solution

Digital Employee eXperience

Your Digital Employee eXperience. Our Mission.

Testing_Visuals_IconNavigation (1)

Quality Engineering

Ensuring seamless software, one Test at a time.

Cegeka Application Services

Cegeka Application Services

Building the applications to embed growth, innovation and agility.

Business Applications

Business Applications

Transform your business with Microsoft Dynamics ERP and CRM, integrated with Microsoft’s Power Platform.

5G_Citymesh

5G & Mobile Private Networks

Expertise and development experience to bring all the advantages of 5G.

Products and platform solutions

Products & Platforms

Software solutions that optimize business processes and drive success.

Services Back
Services
Website_Navigation_IT_Team_Extension_3

IT Team Extension

The best IT professionals to support your projects.

Outsourcing Services

Outsourcing & Managed Services

Outsourcing your IT helps you to focus on your strategy.

Website_Navigation_Consultancy

Consultancy

The right skills and attitude to support the IT projects at your office

Website_Navigation_Projects

Projects

Integrating the right digital solutions for your IT project

Industries Back
Industries

Our industry-tailored services are designed to address specific challenges and opportunities across different industries.

All industries
government 1

Government and Public Sector

Digital transformation for smarter, citizen-focused public services.

energy_utilities 1

Energy & Utilities

The arrival of smart electricity grids will allow companies to take care of their own energy management

defense 1

Defense & Security

Mission-ready IT securing critical infrastructure and data sovereignty.

food 1

Food

Streamline operations, ensure traceability and maintain compliance.

finance 1

Finance & Insurance

Cloud-powered innovation for agile, secure financial services.

manufacturing 1

Manufacturing

Production chains are becoming intelligent networks with real-time track-and-trace systems.

Insights Back
Knowledge is our backbone

We believe in sharing our insights and expertise with you. Explore our resources and learn more about our products, services and industry trends.

Icons_Navigation_Case Studies

Case Studies

Step into the world of our delighted customers and see how we helped them achieve their goals.

Icons_Navigation_News Items

Corporate News

Stay in the loop with our company news, announcements, awards and events.

Icons_Navigation_Blogs

Blogs

Read our latest articles on topics ranging from technology, innovation, business and beyond.

Icons_Navigation_Webinars

Webinars

Be part of the action with our live or on-demand webinars, where our experts share invaluable knowledge.

Icons_Navigation_Ebooks

E-books & Whitepapers

Download our guides and reports on various aspects of technology and business.

Icons_Navigation_Events

Events

Find out where we are going to be next, and register for our upcoming events.

CTG Academy

Academy

Enhance your skills with our expert-led training courses, tutorials, and certifications at our Academy.

Join our Academy
About us Back
shaping digital together

We work shoulder to shoulder with our clients to ensure technology drives impact when and where it matters most.

Start the journey with us
Icons_Navigation_Why Cegeka

Why Cegeka

Discover why more than 2,500 clients around the world choose to work with us, and stay with us.

Icons_Navigation_Cegeka&Society

ESG at Cegeka

We turn ESG ambition into action via sustainable IT, carbon footprint reduction and an inclusive work environment.

Icons_Navigation_Our Story

The Cegeka Story

In just over 30 years, Cegeka has grown from 30 people to a global company with 9,000 employees across 3 continents.

Icons_Navigation_Annual Report

Annual Report

See how our work makes a difference, explore the full annual report to learn more.

More Cegeka

Our Management

Corporate News

Contact & Locations

Back
Select language

Austria

Belgium

Belgium

Denmark

Germany

Italy

Romania

Sweden

The Netherlands

United Kingdom

United States

Let’s get in touch
Cegeka_Logo Solutions
Solutions
Hybrid Cloud

Hybrid Cloud

Explore the added value of cloud adoption for your business.

Data solution

Data & AI

Discover our different data solutions to help you become a data-driven company.

RegulatoryCompliance_Visuals_Navigation (1)

Regulatory Compliance

Ensure GDPR & GxP compliance with our comprehensive solutions.

Cyber Security & Networking Solution

Cyber Security & Networking

With cyber resilience, your organisation becomes a bit more secure with each day.

Digital Workplace Solution

Digital Employee eXperience

Your Digital Employee eXperience. Our Mission.

Testing_Visuals_IconNavigation (1)

Quality Engineering

Ensuring seamless software, one Test at a time.

Cegeka Application Services

Cegeka Application Services

Building the applications to embed growth, innovation and agility.

Business Applications

Business Applications

Transform your business with Microsoft Dynamics ERP and CRM, integrated with Microsoft’s Power Platform.

5G_Citymesh

5G & Mobile Private Networks

Expertise and development experience to bring all the advantages of 5G.

Products and platform solutions

Products & Platforms

Software solutions that optimize business processes and drive success.

Services
Services
Website_Navigation_IT_Team_Extension_3

IT Team Extension

The best IT professionals to support your projects.

Outsourcing Services

Outsourcing & Managed Services

Outsourcing your IT helps you to focus on your strategy.

Website_Navigation_Consultancy

Consultancy

The right skills and attitude to support the IT projects at your office

Website_Navigation_Projects

Projects

Integrating the right digital solutions for your IT project

Industries
Industries

Our industry-tailored services are designed to address specific challenges and opportunities across different industries.

All industries
government 1

Government and Public Sector

Digital transformation for smarter, citizen-focused public services.

energy_utilities 1

Energy & Utilities

The arrival of smart electricity grids will allow companies to take care of their own energy management

defense 1

Defense & Security

Mission-ready IT securing critical infrastructure and data sovereignty.

food 1

Food

Streamline operations, ensure traceability and maintain compliance.

finance 1

Finance & Insurance

Cloud-powered innovation for agile, secure financial services.

manufacturing 1

Manufacturing

Production chains are becoming intelligent networks with real-time track-and-trace systems.

Insights
Knowledge is our backbone

We believe in sharing our insights and expertise with you. Explore our resources and learn more about our products, services and industry trends.

Icons_Navigation_Case Studies

Case Studies

Step into the world of our delighted customers and see how we helped them achieve their goals.

Icons_Navigation_News Items

Corporate News

Stay in the loop with our company news, announcements, awards and events.

Icons_Navigation_Blogs

Blogs

Read our latest articles on topics ranging from technology, innovation, business and beyond.

Icons_Navigation_Webinars

Webinars

Be part of the action with our live or on-demand webinars, where our experts share invaluable knowledge.

Icons_Navigation_Ebooks

E-books & Whitepapers

Download our guides and reports on various aspects of technology and business.

Icons_Navigation_Events

Events

Find out where we are going to be next, and register for our upcoming events.

CTG Academy

Academy

Enhance your skills with our expert-led training courses, tutorials, and certifications at our Academy.

Join our Academy
About us
shaping digital together

We work shoulder to shoulder with our clients to ensure technology drives impact when and where it matters most.

Start the journey with us
Icons_Navigation_Why Cegeka

Why Cegeka

Discover why more than 2,500 clients around the world choose to work with us, and stay with us.

Icons_Navigation_Cegeka&Society

ESG at Cegeka

We turn ESG ambition into action via sustainable IT, carbon footprint reduction and an inclusive work environment.

Icons_Navigation_Our Story

The Cegeka Story

In just over 30 years, Cegeka has grown from 30 people to a global company with 9,000 employees across 3 continents.

Icons_Navigation_Annual Report

Annual Report

See how our work makes a difference, explore the full annual report to learn more.

More Cegeka

Our Management

Corporate News

Contact & Locations

Austria   Austria DE Belgium   Belgium NL Belgium   Belgium FR Denmark   Denmark EN Germany   Germany DE Italy   Italy IT Romania   Romania EN Sweden   Sweden EN The Netherlands   The Netherlands NL United Kingdom   United Kingdom EN United States   United States EN Careers Let’s get in touch
Home Discover our latest blogs Discover our latest blogs Agentic AI Test Automation with Playwright
Quality Engineering
6 minutes reading

Agentic AI Test Automation with Playwright

If you’ve been in web development or QA for a while, you’ve almost certainly heard of Playwright, Microsoft’s open-source browser automation framework known for its speed, reliability, cross-platform and cross-browser support.

David Henderickx

David Henderickx

February 04, 2026

Launched in 2020, it has steadily grown into one of the most trusted tools in modern test automation projects, with adoption accelerating rapidly in the past few years.

Now, as we enter the era of AI-augmented development, Playwright has taken a major leap forward with the introduction of Playwright MCP in March 2025 and Playwright Agents in October 2025. Two additions that provide us with intelligent, agentic test automation.

In this blog post, we’ll explore the concepts behind Playwright MCP and Playwright Agents, what they are, how they work, how they interact with LLMs, and why they represent the next paradigm for writing and maintaining tests.

1. Playwright MCP

MCP stands for Model Context Protocol, an open standard created by Anthropic and adopted by many companies, including Microsoft for Playwright.

An MCP is the bridge that allows LLMs (Large Language Models like ChatGPT, Claude, Gemini,...) to safely and reliably interact with tools, APIs and applications in a standardized, secure way.

Before MCP, every AI tool needed its own custom integration with an application, API or test automation framework. This caused problems:

  • duplicated integrations
  • inconsistent capabilities
  • security challenges
  • no standard way for AI to access tools

MCP solves this by defining a shared, open protocol.

For Playwright MCP, this means that it provides:

  • A well-defined set of tools that can be used: The Playwright functions like page.goto, page.click, page.getByText, ...
  • A sandboxed environment: The LLM can only request what Playwright can do with the browser (e.g. click on an element, open a page) and Playwright MCP returns only the information that the LLM is allowed to know (e.g. DOM trees, errors, events).
  • Strict security and safety rules: The LLM has no direct control over the browser protocol, network requests, local storage, custom javascript code execution, ...
  • A standard format for interactions between the LLM and Playwright

The LLM requests an “intention”, and Playwright MCP decides whether and how to execute them through Playwright.

2. Playwright Agents

The Playwright Agents are specialized, thin orchestrators built around an LLM for Playwright. The LLM is external.

You can think of the Playwright Agents as:

  • the reasoning loop supervisor
  • the translator between LLM instructions and browser commands
  • the executor of actions
  • the safety + structure layer

The intelligence (understanding instructions and making decisions) comes from the LLM model, not from Playwright itself.

By creating a LLM independent agent, test generation relies on the selected LLM to interpret your natural-language instruction and decide:

  • what steps to perform
  • which element locators to use
  • how to structure the test
  • how verbose or concise the tests are
  • how resilient the test is (e.g. retries, robustness)
  • what coding style to use (e.g. async/await, comments, types)

Since each LLM has different reasoning abilities, styles, and training data, the output varies between the chosen LLM and you can choose yourself the best suited one for your project.

If Playwright MCP is the bridge, as mentioned in previous chapter, Playwright Agents are the intelligent workers crossing it.

There are 3 Agents in Playwright:

  • Planner Agent
  • Generator Agent
  • Healer Agent

These agents work together (and individually) to turn natural language instructions into valid and stable Playwright tests.

Media 1920x1080px-3

2.1 Planner Agent

The planner agent can be seen as the project manager of the AI based test creation.

It will try to discover test cases by:

  1. interpreting your natural-language instructions, which can be very general (e.g. “create test cases for my web application”) or very specific (e.g. “create test cases for the checkout page on my e-commerce application”)
  2. exploring the web application automatically through the Playwright MCP tools
  3. identifying the needed user flow(s)
  4. creating scenarios and breaking them down into test steps

The output of these actions will be a human-readable test plan in markdown format (.md).

Example basic-operations.md:

# Test Plan: Basic Operations

## Overview
This plan covers essential user flows for the Example App homepage.

### Scenarios
1. **Navigate to Homepage**
   - Open `https://example.com`
   - Verify page title contains "Example Domain"

2. **Click "More information" Link**
   - Locate link with text "More information"
   - Click the link
   - Verify navigation to IANA page

3. **Check Heading**
   - Ensure first `<h1>` element is visible
   - Assert text equals "Example Domain"

2.2 Generator Agent

The generator agent acts as the developer of your automated test cases.

It will write the actual Playwright test code by:

  1. getting the markdown test plan from the agent
  2. trying to execute the steps on the web application automatically through the Playwright MCP tools. During this action it defines the element selectors, assertions and setup code. It will retry an action (like selecting an element in a dropdown) in different ways until it actual works.

The output of these actions will be files containing coded tests (.spec).

Example test.spec.ts:

Import { test, expect } from '@Playwright/test';

test.describe('Basic Operations', () => {
  test('Navigate to Homepage and verify title', async ({ page }) => {
    await page.goto('https://example.com');
    await expect(page).toHaveTitle(/Example Domain/);
  });

  test('Click "More information" and verify navigation', async ({ page }) => {
    await page.goto('https://example.com');
    await page.getByRole('link', { name: 'More information' }).click();
    await expect(page).toHaveURL(/iana\.org/);
  });

  test('Check heading text', async ({ page }) => {
    await page.goto('https://example.com');
    const heading = page.locator('h1');
    await expect(heading).toBeVisible();
    await expect(heading).toHaveText('Example Domain');
  });
});

2.3 Healer Agent

The healer agent acts as the bug fixer of your automated test cases.

When a test fails, the healer will:

  1. navigate to the page where the step is failing
  2. inspect the live DOM
  3. ask the LLM to determine what changed
  4. propose a patch (new element selector, element interaction or updated flow)
  5. update the impacted test(s) automatically if allowed

3. Using Playwright MCP or Playwright Agents

3.1 LLM interacts directly with Playwright MCP

The LLM sends MCP commands directly to Playwright to execute an action in the browser.

Pros:

  • Lower latency: There is direct communication without intermediate layers.
  • Full control: You can build your own agent to manage prompts, enforce safety rules, add domain specific knowledge, define how to generate the test cases, ...

Cons:

  • LLM must handle everything: Planning, error recovery, retries, interpreting DOM and validating output.
  • Test Generations: given prompts need clear multi-step reasoning.
  • Limited autonomy: The LLM is stateless between calls unless you build session memory.
  • More brittle: If the LLM hallucinates or makes a mistake, there is no built -in correction phase.

Media 1920x1080px-1-1

High level code example:

sync with ClientSession(*stdio) as session:
        # Initialize and discover server capabilities
        await session.initialize()
        tools = await session.list_tools()
        print("Available tools:", [t.name for t in tools.tools])

        # 1) Navigate
        result_nav = await session.call_tool("browser_navigate", {"url": "https://example.com"})
        print("Navigate result:", result_nav)

        # 2) Grab an accessibility snapshot (LLM-friendly DOM)
        result_snap = await session.call_tool("browser_snapshot", {})
        # The content contains structured text/ARIA data that your LLM can reason over
        print("Snapshot length:", len(result_snap.content[0].text))

        # 3) Click a link by visible text (example; adjust to your page)
        result_click = await session.call_tool("browser_click_text", {"text": "More information"})
        print("Click by text result:", result_click)

        # 4) Cleanly close
        await session.call_tool("browser_close", {})

3.2 LLM interacts with Playwright Agent  

The LLM instructs a Playwright Agent to execute an action in the browser

Pros:

  • Separation of concerns: LLM focuses on reasoning, while the agent handles execution details.
  • Built in reliability: The agents provide more consistent tests by having planning, validation and healing in the agent pipeline.
  • Standardized workflow: Everyone uses the same tested and optimized process. No need to reinvent prompt engineering or agent design
  • Better scalability: You can easily swap LLMs or add multi-step workflows.
  • Higher productivity: The heavy lifting is done by the agents.

Cons:

  • Extra layer: More overhead and complexity
  • Standardized workflow: The tests are generated according to Playwright’s design.
  • Harder to debug internal logic: The agents operate like a block box, you get the result, not the internal trace.

Media 1920x1080px-3-1

High level code example:

#1) Natural-language task; agent decides which tools to call & in what order
instruction = """
Open https://example.com, click the link with text 'More information',
then extract the first <h1> you see and return it as plain text.
"""

result = agent.run(instruction)

4. Should we start using Playwright Agents?

With all this new exciting functionality, we would almost forget that there are some downsides on using the Playwright Agents:

  • Limited Control & Predictability: The agents rely on LLM reasoning, which can introduce non-deterministic tests
  • Quality: The quality of the generated test rely on the prompt design and the UI/flow interpretation of the LLM.
  • Standard: The agents don’t provide the possibility to use custom test structure, test formatting, custom locator strategy, 3th party integration, ...
  • Resources: Agents need to spin up LLM’s and browser sessions which increases CPU/RAM usage, but especially execution time.
  • Governance & Security Concerns: Access to LLM models could be an issue for sensitive apps or regulated environments
  • Debugging Complexity: When something goes wrong, it can be an issue with the agent, the LLM or Playwright.
  • Costs: The agents have a bigger impact on your infrastructure, but also the cost of an LLM license can increase exponentially for large scale testing activities.

So if speed and having automation matters more than absolute control and cost, definitely give Playwright Agents a go! They give us a new step in the exciting times to come for test automation!

David Henderickx

David Henderickx

More of David Henderickx articles

Get in touch

Send us a message

tim.taels@cegeka.com

Tim Taels

Account Executive