·8 min read
Playwright Best Practices: 10 Rules AI Agents Get Wrong (2026)
The 10 Playwright best practices for stable tests in 2026, and the ones AI code agents like Copilot and Cursor get wrong.

Published: · 3 min read
AI agents made it worse. They still get stuck at login screens. This month, that changed. MCP (how AI talks to tools) is changing how we test. Two teams at Microsoft shipped a fix. They released two ways to share your browser with AI. Playwright core added browser.bind(). The CLI team added an MCP Bridge. Both land in the same month. This is not a test. It is the new way.
On this page
AI agents made it worse. They still get stuck at login screens. This month, that changed.
MCP (how AI talks to tools) is changing how we test. Two teams at Microsoft shipped a fix. They released two ways to share your browser with AI.
browser.bind().Both land in the same month. This is not a test. It is the new way.
Browser tests have a "login gap." Headless browsers (browsers without a window) start empty. They have no cookies, sessions, or secure login codes.
When your app needs a company login, a headless browser fails. Teams solve it with hacks. We export cookies, make "special" accounts, or snapshot Docker images.
I spent 20% of my time just keeping these hacks alive. These new tools don't solve login. They skip it. The human logs in once. The agent uses the same browser.
browser.bind() Doesbrowser.bind() shares the browser you are already using. It shares your cookies and your tabs. When you call it, Playwright creates a local data connection.
Any AI agent connects to that pipe. It sees the exact same browser you see.
import { chromium } from 'playwright';
const browser = await chromium.launch({ headless: false });
const context = await browser.newContext();
const page = await context.newPage();
// Log in manually. Run your setup.
await page.goto('https://internal-dashboard.example.com');
// Share the browser with AI agents.
const binding = await browser.bind({ pipe: '/tmp/playwright-pipe' });
// Now Claude can use this exact browser.
// Same cookies. Same session.
This is for developers. One line of code. No more re-logging in. No more cookie scripts.
The extension is the "no-code" path. Install it in Chrome and click one button. Your open tab now talks to your AI.
Claude (the AI) sees the page. It can click and type. No terminal needed. Just one click.
Before: Login -> export cookies -> start new browser.
After: Click the extension. Done.
# Connect your tools to the extension
playwright-cli attach --extension
Both tools shipped in one month. They solve the same pain.
This is a standard being born. Before, every team built their own bridge to the browser. Now, it is a standard feature.
Two teams shipped one pattern in 30 days. The signal is clear. The browser is now a shared space. Humans and AI agents work on the same surface.
What does this mean for QA? It means you stop babysitting login scripts. Your AI agent tests run where your humans test. The wall between "human" and "agent" testing is gone.
The win is not just a faster script. The win is "Shared State." Before, we had parallel worlds. One human click and one agent click meant two browsers and two truths.
Now they are one. When an AI agent finds a bug, you open the same browser. You see the same state and same session.
No more "it works on my machine." Same browser. Same bug.
If you use Playwright, browser.bind() is in v1.59.0. If you want the no-code path, get the extension. Then run playwright-cli attach --extension.
Both connect your agent to a real, logged-in browser. Not a toy. Use the browser your team uses.
Anton Gulin is the AI QA Architect — the first person to claim this title on LinkedIn. He builds AI-powered test automation systems where AI agents and human engineers collaborate on quality. Former Apple SDET (Apple.com / Apple Card pre-release testing). Find him at anton.qa or on LinkedIn.
Get notified when I publish something new, and unsubscribe at any time.
·8 min read
The 10 Playwright best practices for stable tests in 2026, and the ones AI code agents like Copilot and Cursor get wrong.

·3 min read
An honest method for benchmarking LLM speed: tokens per second vs time to first token, across 42 Ollama Cloud models, measured every 10 minutes.

·3 min read
Learn how to generate clean test scripts using Playwright Codegen, and how to scale those drafts into a production-ready test architecture.
