<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Some technical thoughts]]></title><description><![CDATA[A blog about building and testing reliable systems. Topics include test automation, distributed systems behavior, observability, performance engineering, and fa]]></description><link>https://alexis-moreno.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/69ea72a9904b915438b13b18/c69fd84d-e67f-48f6-bc34-8320910db1a3.png</url><title>Some technical thoughts</title><link>https://alexis-moreno.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Thu, 17 Sep 2026 07:35:19 GMT</lastBuildDate><atom:link href="https://alexis-moreno.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[AI-Driven Test Automation: What Works and What Doesn’t]]></title><description><![CDATA[Software testing is shifting as AI starts to influence how test automation is built and maintained. Traditional approaches rely on deterministic scripts and stable selectors, which work well for CI re]]></description><link>https://alexis-moreno.hashnode.dev/ai-driven-test-automation-what-works-and-what-doesn-t</link><guid isPermaLink="true">https://alexis-moreno.hashnode.dev/ai-driven-test-automation-what-works-and-what-doesn-t</guid><category><![CDATA[AI]]></category><category><![CDATA[QA]]></category><category><![CDATA[qa testing]]></category><category><![CDATA[automation testing ]]></category><dc:creator><![CDATA[Alexis Moreno]]></dc:creator><pubDate>Tue, 05 May 2026 18:22:37 GMT</pubDate><content:encoded><![CDATA[<p>Software testing is shifting as AI starts to influence how test automation is built and maintained. Traditional approaches rely on deterministic scripts and stable selectors, which work well for CI reliability but break down with brittle UI changes and high maintenance overhead.</p>
<p>AI introduces a different model: generating tests from specifications, stabilizing selectors through semantic understanding, and exploring application behavior beyond predefined flows. These gains come with trade-offs—non-determinism, higher costs, and added complexity.</p>
<p>This article examines where AI actually adds value in test automation, where it doesn’t, and how to integrate it without compromising system reliability.</p>
<h3>What AI Can Realistically Do in Testing Today vs. Hype</h3>
<p>The current wave of AI tooling in software development has created strong expectations that testing can become largely autonomous. In practice, the most reliable uses of AI in QA today are assistive rather than fully autonomous. AI can meaningfully accelerate certain parts of the testing workflow, but deterministic automation and human oversight remain essential for stable test pipelines.</p>
<p>A realistic framing is that AI is strongest in areas where <strong>pattern recognition, summarization, or code generation</strong> are valuable. For example, large language models can help generate initial test cases from user stories, API schemas, or UI descriptions. This can significantly reduce the time required to create new test suites. Similarly, AI can assist with test maintenance by suggesting refactors, identifying duplicated test logic, or proposing updates when selectors change. These capabilities help address one of the most expensive aspects of automation: long-term maintenance.</p>
<p>AI also shows promise in exploratory testing. Autonomous browser agents can navigate an application, attempt flows that were not explicitly scripted, and surface unusual UI states or potential defects. While these agents are not reliable enough for regression pipelines, they can help QA teams discover edge cases earlier in development cycles.</p>
<p>The hype often suggests that AI can replace deterministic automation entirely. In reality, AI systems introduce non-determinism: the same prompt may produce slightly different actions or reasoning steps across runs. This makes failures harder to reproduce and debug, which is a critical requirement for CI pipelines. Because of this, AI-driven testing works best as a complement to traditional automation, not as a replacement.</p>
<p>A practical strategy emerging in many teams is a hybrid testing model: deterministic frameworks handle regression testing and CI reliability, while AI tools assist with test generation, maintenance, and exploratory discovery.</p>
<h3>Pros and Cons of AI in Test Automation</h3>
<p><strong>Pros</strong></p>
<ol>
<li><p><strong>Reduced selector brittleness:</strong> One of the most common causes of flaky UI tests is fragile selectors. When developers change DOM structure or class names, large parts of a test suite can break. AI-based semantic matching can help stabilize locators by identifying elements based on meaning rather than exact selectors.</p>
</li>
<li><p><strong>Faster test generation:</strong> AI can accelerate the early stages of automation by converting documentation into test skeletons.</p>
</li>
<li><p><strong>Exploratory testing automation:</strong> AI agents can navigate applications and explore flows that may not be covered by scripted tests.</p>
</li>
<li><p><strong>Maintenance assistance:</strong> AI tools can help refactor tests and detect outdated logic.</p>
</li>
</ol>
<p><strong>Cons</strong></p>
<ol>
<li><p><strong>Non-deterministic behavior:</strong> AI systems may produce slightly different outputs across runs, even when given the same input. For CI environments, determinism is often more valuable than flexibility.</p>
</li>
<li><p><strong>Slower execution:</strong> AI reasoning steps introduce additional latency compared with deterministic scripts.</p>
</li>
<li><p><strong>Increased architectural complexity:</strong> Integrating AI often requires additional infrastructure such as orchestration layers, prompt management, and execution monitoring.</p>
</li>
<li><p><strong>Cost growth:</strong> Running AI models repeatedly inside test pipelines could become expensive.</p>
</li>
</ol>
<h3><strong>Example Architectures for Integrating AI into Test Automation</strong></h3>
<p>Integrating AI into a QA workflow requires architectural decisions about how much autonomy the AI should have, how deterministic the system must remain, and how much infrastructure the team is willing to maintain. Several architectural patterns are emerging in practice. The most common ones range from fully autonomous browser agents to lighter integrations where AI assists developers through command-line workflows or custom orchestration layers.</p>
<p><strong>Autonomous Browser Agents (MCP-based)</strong></p>
<p>One approach is to expose browser automation frameworks—such as Playwright <a href="https://playwright.dev/docs/getting-started-mcp">(playwright MCP here)</a>—as structured tools that an AI agent can control. Using the Model Context Protocol (MCP), the automation framework acts as a tool server that the model can interact with. The AI receives the current browser state, reasons about the next action, executes it through Playwright, and repeats the cycle.</p>
<p>The interaction loop typically looks like this:</p>
<ol>
<li><p>Application → Browser state</p>
</li>
<li><p>Browser state → AI agent</p>
</li>
<li><p>AI agent → next action</p>
</li>
<li><p>Playwright → execute action</p>
</li>
<li><p>Repeat</p>
</li>
</ol>
<p>In this architecture, the AI acts as an <strong>autonomous exploratory tester</strong>. It can navigate the application, attempt different flows, and investigate unexpected UI states without predefined scripts.</p>
<p>This approach works particularly well for:</p>
<ul>
<li><p>exploratory testing</p>
</li>
<li><p>discovering unexpected user flows</p>
</li>
<li><p>detecting UI anomalies</p>
</li>
</ul>
<p>However, because the agent relies on model reasoning at every step, <strong>execution tends to be slower and more expensive</strong>. Additionally, the system may behave differently across runs due to the non-deterministic nature of LLM reasoning. For these reasons, autonomous agents are not useful for being integrated inside regression pipelines and are instead are more suitable to run as separate exploratory test processes.</p>
<p><strong>CLI-based AI Assistants with Reusable skills</strong></p>
<p>A more deterministic approach is to integrate AI through command-line workflows where <strong>the model assists QA engineers</strong> rather than directly controlling the browser. In this architecture, AI tools interact with the repository and automation framework through structured commands. Reusable instruction bundles — called skills <a href="https://playwright.dev/agent-cli/skills">(playwright skills here)</a> — define tasks that the AI can perform.</p>
<p>For example using playwright skills an LLM could perform tasks such as:</p>
<ul>
<li><p>generating tests from Playwright codegen recordings</p>
</li>
<li><p>diagnosing failing tests</p>
</li>
<li><p>patching broken selectors</p>
</li>
<li><p>refactoring test utilities</p>
</li>
</ul>
<p>A typical workflow might look like this:</p>
<ol>
<li><p>Run tests → failure detected</p>
</li>
<li><p>We run a script that calls AI sending the logs/DOM/application state</p>
</li>
<li><p>AI assistant analyzes logs</p>
</li>
<li><p>AI suggests fix or patch (it could even create a PR)</p>
</li>
<li><p>QA Engineers reviews change and merges it</p>
</li>
<li><p>Tests rerun</p>
</li>
</ol>
<p>Because the AI operates within structured commands rather than an autonomous browser loop, this architecture offers several advantages: lower cost faster execution greater determinism It also fits naturally into CI pipelines because the automation itself remains deterministic. The AI acts as a <strong>developer assistant</strong> rather than a testing agent.</p>
<p><strong>Custom AI Orchestration Layer</strong></p>
<p>Teams with stricter requirements for performance, determinism, or cost control could build their own AI orchestration layer on top of existing automation frameworks. In this architecture, the system explicitly controls the interaction between the application, the automation framework, and the language model.</p>
<p>A simplified loop for a self healing flow might look like this:</p>
<ol>
<li><p>Crawl page</p>
</li>
<li><p>Extract structured state (DOM, elements, metadata)</p>
</li>
<li><p>Send structured context to LLM</p>
</li>
<li><p>LLM returns next action</p>
</li>
<li><p>Automation framework executes action</p>
</li>
<li><p>Loop</p>
</li>
</ol>
<p>Unlike fully autonomous agents, this system allows developers to enforce strict guardrails, such as:</p>
<ul>
<li><p>schema validation for model outputs</p>
</li>
<li><p>limited action sets</p>
</li>
<li><p>deterministic fallbacks</p>
</li>
<li><p>token usage limits</p>
</li>
</ul>
<p>This architecture provides maximum flexibility and can be optimized for:</p>
<ul>
<li><p>CI integration</p>
</li>
<li><p>cost efficiency</p>
</li>
<li><p>deterministic behavior</p>
</li>
<li><p>to determine what we share with the LLM</p>
</li>
</ul>
<p>However, it requires significantly more engineering effort. Teams must maintain their own orchestration logic, prompt design, and monitoring infrastructure.</p>
<h3>Choosing the Right Architecture</h3>
<p>Each architecture represents a different balance between autonomy, determinism, cost, and engineering complexity.</p>
<p>In practice, it is best to adopt a hybrid approach:</p>
<ul>
<li><p>CLI-based AI assistants for developer productivity and test maintenance</p>
</li>
<li><p>deterministic automation frameworks for regression</p>
</li>
<li><p>testing autonomous browser agents for exploratory testing and edge-case discovery</p>
</li>
</ul>
<p>This separation allows QA teams to benefit from AI capabilities without compromising the stability of CI pipelines.</p>
<h3><strong>Conclusion</strong></h3>
<p>AI can significantly improve parts of the testing workflow. However, current systems introduce non-determinism, cost, and architectural complexity that make them unsuitable as a full replacement for deterministic automation. The most practical approach today is a hybrid model: stable regression suites remain deterministic, while AI tools are used to accelerate development and explore application behavior beyond predefined tests.</p>
<hr />
<p><em><strong>Disclaimer</strong></em></p>
<p><em>The content on this blog reflects my personal opinions and ideas. It does not represent the views of my employer, clients, or any affiliated organizations.</em></p>
<p><em>All information is provided for informational purposes only and without warranty. I am not responsible for any use or misuse of the content.</em></p>
]]></content:encoded></item></channel></rss>