
Article
Playwright vs Selenium: Key Insights to Pick the Right Tool
Dive into the Article
We use cookies
We use cookies to understand how you found us and improve your experience. You can accept or decline analytics cookies. Learn more in our privacy policy.
Auto Playwright turns plain-text instructions into Playwright test steps with AI. We set it up, ran a shopping cart test, and share where it helps and where it falls short.

Auto Playwright is an AI-powered extension of Playwright that uses OpenAI models to turn plain-language instructions into browser actions, so teams write less test code by hand. After testing it, we found it can speed up test writing, but it runs significantly slower than traditional methods, OpenAI API calls add a cost that can be prohibitive for some organizations, and occasional API call failures can result in inconsistent test results. That’s why we recommend it only for less frequent tests without much complexity, as a complement to more robust automation.
One of the most popular tools in the test automation field is Playwright, which provides a solid foundation for robust and reliable testing, including the ability to create playwright api test cases efficiently. It’s an open-source framework that facilitates the creation of automated tests for web applications and allows running them across various browsers.
Auto Playwright builds on that foundation by adding AI to Playwright, which simplifies how test steps are written and run.
Playwright itself has also added AI capabilities. Since version 1.56, it includes Playwright Test Agents, three agent definitions (planner, generator, and healer) designed to guide LLMs through building a Playwright test. Auto Playwright works differently. Inside a regular Playwright test, you call its auto() function with a plain-text instruction, and the tool runs the matching steps.
Does Auto Playwright improve test development efficiency? We answer this in detail in this article by conducting tests with real use cases and analyzing both its capabilities and limitations. For technology leaders and organizations exploring AI-driven testing, Auto Playwright offers a glimpse into how AI can accelerate automation while highlighting important considerations for scaling quality practices.
Want to apply AI to test automation with the right governance? Our experienced engineers work alongside AI agents to deliver faster and safer outcomes. Explore our case studies.

By applying AI to test automation, Auto Playwright acts as an intelligent intermediary between plain text commands and the code required to run automated tests. Through OpenAI’s function-calling interface, it converts natural-language instructions into executable steps. This practical use of AI simplifies automation, reduces manual coding, and makes quality assurance more scalable across teams.
Rather than replacing developers, Auto Playwright enhances productivity by shifting the focus from repetitive scripting to strategic test design. For decision makers, this means faster delivery cycles, optimized team resources, and lower barriers to adopting AI-driven practices.
This visionary initiative was inspired by the ZeroStep project, which offers a similar API but with a more robust implementation through its proprietary backend. With Auto Playwright, the same idea becomes an open-source library that teams can explore, although its author suggests ZeroStep for production environments.
Auto Playwright works by turning plain-text instructions into executable test steps with the help of AI, streamlining web test automation and reducing manual coding effort.
First and foremost, you need to write tests in plain text.
These instructions must describe the actions or checks you want to perform on your web application, like “click the login button” or “get the page title”. This makes it a valuable tool in web development workflows, where maintaining application integrity through automation is key to product quality.
For example, in a user registration process, you could automate the complete flow from opening the registration page to submitting the form and confirming successful account creation, using plain text prompts.
Then, Auto Playwright sends them, along with a sanitized version of the page HTML, to an OpenAI model, which interprets each instruction and picks the Playwright functions to call.
Auto Playwright then executes those functions to perform the described actions. For instance, it could be clicking, filling out forms, navigating different pages, or searching and verifying content. From simple clicks to form submissions, it can mimic various user interactions required to validate front-end behavior accurately.
A common use case includes validating a search text input, where users type queries to filter or retrieve specific data within the application.
Here you can find all the actions Auto Playwright handles.
As these functions are executed, Auto Playwright provides information or results. Running these steps from natural-language instructions streamlines test creation for developers and testers alike, confirming actions, retrieving data, or validating assertions.
This may include confirmation of successfully performed actions, data retrieved from the page, or the results of checks and assertions made.
Next, we’ll explore how to get started with the tool, from installation to running your first automated tests. We’ll also analyze the value its use would bring to your projects.
Don’t miss this webinar (in Spanish) with tips for low-code test automation.

Getting started with Auto Playwright, the AI-powered test automation library, only takes a few steps. In this guide, we’ll walk you through the complete setup process, from installing Node and Playwright to configuring your OpenAI API key, so your team can begin creating AI-driven automated tests quickly and efficiently.
Like any project based on Node, we need to meet certain prerequisites.
First, we need Node installed on our computer. Additionally, we require an Integrated Development Environment (IDE). In our case, we’ll use VSC. Once installed, we can start setting up Auto Playwright.
Next, we share a step-by-step guide to help you on this path.
OpenAI is an AI research and deployment company, and Auto Playwright relies on its API to interpret each instruction.
To get an OpenAI API key, you must register on the OpenAI platform, create an account, and, if required, verify your email/phone. Next, open or create a Project in the dashboard.
One detail about this tool is that each auto() call sends a request to the OpenAI API, which is billed by usage according to OpenAI’s current pricing. You can find the most up-to-date pricing information here.
For this, you should run: npm init playwright@latest
At this step, you ought to run npm install auto-playwright -D in the console.
At this point, we’ll see all the dependencies, including the Auto Playwright dependency in our package.json:

In this last step, you need to set the environment variables in the .env file following the tool’s documentation.
Remember, this API key is the one generated in step 1: OPENAI_API_KEY='sk-...'
These steps are essential to get the tool up and running, but in more advanced setups, additional authentication layers may be required.
With these steps, Auto Playwright is ready to use. Your team can now start creating AI-powered automated tests right away, moving from setup to practical test scenarios with minimal effort.
Debugging is a critical part of any test automation strategy, and Auto Playwright includes a debug option for it.
While writing effective tests is vital, understanding how they behave during execution is equally important. Auto Playwright supports this need with its debug mode, and Playwright adds its own debugging tools.
A standout tool is the Playwright Inspector, part of Playwright itself, a GUI that lets you step through your tests, pick and live edit locators, and see actionability logs. This helps you catch subtle issues, like timing problems or misidentified elements, before they become bugs in production.
When debug mode is on, Auto Playwright prints each prompt and the commands the OpenAI model chose, which Auto Playwright then executes. You can turn it on per call with { debug: true } or for every call with AUTO_PLAYWRIGHT_DEBUG=true. It’s particularly useful for analyzing failures, especially in flows with user inputs, like a registration form, or sequences that depend on specific user-provided data.
Moreover, when validating functionality like search behavior, you may want to confirm that the value of the search box matches your expected input. Playwright Test also runs each test in an isolated browser context, which helps maintain consistent executions.
These practices simplify debugging and make tests more resilient, especially in test suites that evolve frequently and in applications with dynamic application markup that changes over time.

Auto Playwright enables teams to run AI-powered test scenarios by converting plain text prompts into executable Playwright steps. This makes it easier to automate end-to-end testing workflows without writing detailed scripts manually.
How does Auto Playwright run different scenarios? By using the auto function, which accepts human-like instructions and the page and test objects as arguments.
First, we’ll create our tests using the “auto” function.
This function requires a plain-text prompt and an argument that contains your page object and, optionally, your test object.
Next, we share an example (page):
auto("<your prompt>", { page, test });Additionally, we can optionally declare the API model to use through the “options” parameter:
const options = {
// If true, debugging information is printed in the console.
debug: true,
// The OpenAI model (gpt-4o by default)
model: "gpt-4o",
// The OpenAI API key
openaiApiKey: 'sk-...',
};Auto Playwright uses gpt-4o by default, and OpenAI lists GPT-4o as deprecated, with a shutdown date of January 14, 2027, so check its deprecations page before you pick a model.
This is how it would look in each prompt:
auto("<your prompt>", { page, test }, options);With this setup, teams can mix auto() calls with regular Playwright code, such as await page.goto(), and Playwright auto-waits for elements to be actionable before it performs each action.
We need to test the functionality of adding a product to a web application’s shopping cart as part of an end-to-end testing scenario.
To test the functionality, we’ll create two tests.
In the first test, we’ll use several prompts to simulate an action to execute in each of them. For the second one, we’ll create a single prompt, which will contain all the actions sequentially.
import { test, expect } from "@playwright/test";
import { auto } from "auto-playwright";
test('auto Playwright test 1: Shopping cart functionality - Several prompts', async ({ page }) => {
await page.goto('http://opencart.abstracta.us/');
await auto('Go to Phones & PDAs from menu bar', { page, test });
await auto("Add item 'Palm Treo Pro' to cart", { page, test });
await auto('Go to Shopping Cart', { page, test });
const itemsList = await auto('list all items in the cart', { page, test });
expect(itemsList).toContain('Palm Treo Pro');
});
test("auto Playwright test 2: Add a product to the cart with a single prompt", async ({ page }) => {
await page.goto('http://opencart.abstracta.us/');
const result = await auto(`
1. Go to Phones & PDAs from the menu bar.
2. Add item 'Palm Treo Pro' to the cart.
3. Go to the Shopping Cart
4. Verify in the list of items in the cart are the item 'Palm Treo Pro'.`, { page, test });
expect(result).toBeTruthy();
});A successful test could verify the appearance of a success message confirming the product has been added to the cart.
To run our tests in the console, we’ll write npx playwright test. As they execute, we’ll see the information Auto Playwright provides.


Integrating AI tools into your QA workflows aligns with modern testing practices focused on efficiency, scalability, and reduced technical debt.
Although Auto Playwright stands out as an innovative project in test automation, enabling rapid creation of automation flows with minimal setup and helping teams test more efficiently, its current level of sophistication and versatility is not enough for test automation.
Despite its significant contribution to accelerating test development and facilitating script creation, it needs to overcome certain limitations to be considered a comprehensive solution in the test automation field.
Below, we detail its advantages and disadvantages, considering both its capabilities and limitations.
In summary, Auto Playwright has promising potential to improve test development efficiency, but it’s crucial to consider its limitations and evaluate whether it meets expectations in terms of performance, cost, and reliability compared to more established solutions in the market.
In that sense, the side-by-side comparison of Auto Playwright and ZeroStep in the Auto Playwright README sheds light on their strengths and limitations. These differences become especially relevant when selecting tools for complex environments that demand both flexibility and precision.
Based on its limitations and the need for more advanced solutions for demanding test environments, we do not recommend implementing Auto Playwright as the main test automation tool in a development project. While it does not yet fully support self-healing tests, this capability could be a valuable future enhancement to reduce the maintenance of automated scripts.
From our specialists’ perspective, it’s crucial to explore more robust and efficient options that better suit the needs and demands of the testing process.
Ultimately, we would recommend its use only for less frequent and detailed tests, without much complexity, to complement its implementation with other more robust, stable, and efficient testing approaches.
Still, with Playwright advancing toward AI-native browser control through MCP, Auto Playwright offers an early glimpse into how these innovations can shape the future of intelligent test automation.
With nearly 20 years of experience and a global presence, Abstracta is a technology company that helps organizations deliver high-quality software faster by combining AI-powered quality engineering with deep human expertise.
Our expertise spans industries and complex delivery environments. That’s why we’ve built robust partnerships with industry leaders such as Microsoft, Datadog, Tricentis, Perforce BlazeMeter, Sauce Labs, and PractiTest.
Explore our AI-powered test automation solutions and contact us to get started.
News, articles, and resources on building better software.
Read about our privacy policy.

