Modern web applications are becoming more complex, while development teams are expected to release changes faster. Traditional automated tests are good at validating known scenarios, but they usually follow a fixed sequence of actions. When an application changes, those tests may need manual updates.
Agentic QA introduces another approach. Instead of treating automation as a simple list of browser commands, an agent can use a goal, inspect the application, decide what to do next, execute browser actions, and evaluate the result.
For .NET teams, this approach can be built around browser automation frameworks such as Playwright for .NET, combined with an AI agent layer and the existing testing infrastructure.
This article explains how to design such a pipeline, where it makes sense, and what problems developers should consider before using it in production.
What Is Agentic QA?
Traditional test automation generally looks like this:
Test Case
|
v
Open Browser
|
v
Click Element
|
v
Enter Data
|
v
Submit
|
v
Assert Result
The sequence is predefined.
An agentic QA pipeline adds a decision-making layer:
QA Goal
|
v
AI Agent
|
+----> Inspect Application
|
+----> Select Action
|
+----> Browser Automation
|
+----> Observe Result
|
+----> Evaluate
|
+----> Next Action
|
v
Test Result
For example, instead of explicitly defining every interaction, a QA task could be described as:
Verify that a new user can register, log in,
update their profile, and successfully log out.
The agent can break this goal into smaller actions, interact with the browser, inspect the resulting page, and determine whether the expected outcome was reached.
This does not mean conventional tests should be replaced. Agentic automation works best as an additional layer for exploratory, adaptive, and scenario-driven testing.
Why Combine Browser Automation with .NET?
Many organizations already have their testing infrastructure around .NET. They may use C#, CI/CD pipelines, test frameworks, reporting systems, and existing automation libraries.
Using browser automation from C# allows teams to keep these pieces together.
A simplified architecture can look like this:
QA Scenario
|
v
Agent Orchestrator
|
+----------+----------+
| |
v v
Test Context Agent Memory
|
v
Browser Tool
|
v
Playwright for .NET
|
v
Web Application
|
v
Observations / Results
|
v
Evaluation
The important architectural decision is to keep browser access behind well-defined tools rather than allowing the agent to directly control every part of the test infrastructure.
Core Components of an Agentic QA Pipeline
1. Test Goal
The test begins with a clear objective.
For example:
Verify that a customer can add a product
to the cart and complete checkout.
The goal should be specific enough to evaluate, but not necessarily tied to every individual browser click.
2. Agent Orchestrator
The orchestrator manages the agent loop.
Its responsibilities can include:
Providing the test objective
Maintaining the current test state
Calling browser tools
Limiting the number of actions
Recording observations
Evaluating success or failure
Producing a test report
3. Browser Automation Layer
The browser layer performs deterministic operations such as:
Navigate
Click
Fill
Select
Read text
Capture screenshots
Wait for elements
Inspect page state
With Playwright for .NET, these operations can be exposed through C# methods.
A simple browser abstraction might look like this:
public interface IBrowserTool
{
Task NavigateAsync(string url);
Task ClickAsync(string selector);
Task FillAsync(string selector, string value);
Task<string> GetTextAsync(string selector);
Task<string> GetCurrentUrlAsync();
}
The agent does not need to know how the underlying browser connection works. It only needs access to these controlled capabilities.
Building a Basic Browser Tool in C#
A minimal Playwright-based implementation can look like this:
using Microsoft.Playwright;
public sealed class BrowserTool : IBrowserTool
{
private readonly IPage _page;
public BrowserTool(IPage page)
{
_page = page;
}
public async Task NavigateAsync(string url)
{
await _page.GotoAsync(url);
}
public async Task ClickAsync(string selector)
{
await _page.Locator(selector).ClickAsync();
}
public async Task FillAsync(string selector, string value)
{
await _page.Locator(selector).FillAsync(value);
}
public async Task<string> GetTextAsync(string selector)
{
return await _page.Locator(selector).InnerTextAsync();
}
public async Task<string> GetCurrentUrlAsync()
{
return _page.Url;
}
}
The value of this abstraction is not the browser code itself. The important part is that browser capabilities are exposed as controlled operations.
An agent can then reason about which operation to use without having direct access to the entire application runtime.
Designing the Agent Loop
A practical agentic QA loop should be bounded.
A simplified implementation could look like this:
public async Task<TestResult> RunAsync(
string objective,
IBrowserTool browser)
{
var state = new TestState(objective);
for (int step = 0; step < 20; step++)
{
var action = await _agent.DecideNextActionAsync(state);
if (action.Type == ActionType.Complete)
{
return state.IsSuccessful
? TestResult.Passed(state)
: TestResult.Failed(state);
}
await ExecuteActionAsync(action, browser);
var observation = await ObserveAsync(browser);
state.AddObservation(observation);
if (await _agent.ShouldStopAsync(state))
{
break;
}
}
return TestResult.Failed(
state,
"Agent reached the maximum number of steps.");
}
The maximum-step limit is important.
Without a boundary, an agent can repeatedly inspect a page, retry an operation, or make unnecessary decisions. A production pipeline should always have limits around execution time, action count, retries, and resource usage.
Making Browser Actions Agent-Friendly
A common mistake is giving an AI agent only low-level selectors.
For example:
Click "#btn123"
does not provide much semantic information.
A better tool can expose intent:
Click the "Continue to Checkout" button.
The browser implementation can still resolve that action to a locator.
This separation creates two layers:
| Layer | Responsibility |
|---|---|
| Agent | Decides what should happen |
| Tool | Determines how the action is executed |
| Browser | Performs the action |
| Application | Produces the result |
Join the conversation! Your thoughts help the community grow.