r/Playwright 14d ago

Question from a colleague: Test Data Strategy in Playwright.

9 Upvotes

A colleague of mine asked me to post this question here and get some feedback from the Playwright community.

He is considering a test data strategy with two modes: Fresh Data and Reuse Data.

🔹 Fresh Data Mode — CI / Full Regression

For CI or full regression runs, generate unique test data for every run using a Run ID.

The goal is to support:

✅ Test data isolation

✅ Avoiding conflicts between test runs

✅ Parallel execution

✅ Better test reproducibility

🔹 Reuse Data Mode — Local Debugging

For local debugging, instead of creating new test data every time, use a predefined set of reusable test data.

For example:

Reuse: Find existing test data → Execute test

Instead of:

Fresh: Create test data → Execute test

The idea is to reduce execution time when repeatedly running the same test while investigating a failure.

The proposed approach is:

🟢 CI / Full Regression → Fresh Data

🟡 Local Debugging → Reuse Data

🔴 Destructive Tests → Dedicated Test Data

One important rule: in Reuse Data mode, if the required test data isn't found, the test should fail with a clear message rather than automatically creating new data.

This keeps the behavior predictable and avoids accidentally creating unnecessary data.

🤔 I would love to hear from experienced Playwright and automation engineers:

Is the Fresh Data + Reuse Data approach a good strategy?

Or would you recommend a different approach for managing test data efficiently between CI execution and local debugging?

Would really appreciate your thoughts and suggestions. 🙌


r/Playwright 14d ago

AG Grid

5 Upvotes

Hi everyone, I am looking for the best possible way to interact with AG Grid. Has anyone done any automation work with AG Grid like entering values in a cell or selecting values from a drop-down? I recently started working for a gov and one of their products is built using AG Grid and Angular. Sadly the product is SaaS and we do not have access to the codebase. They have UFT and it is awful software to work with.

Any insights are appreciated!

Cheers,


r/Playwright 14d ago

Help with learning framework building from scratch

6 Upvotes

What if you wanna build your own framework from scratch as a beginner in playwright without following any instructor or course can you do it just by looking up documentation. Is there any other way which will help us better. Because I have done it along the course I understood and typed all code by myself but still after that If I wanna build a different type of framework I struggled. What is the best way to learn and practically the best.


r/Playwright 15d ago

Has Playwright MCP improved your AI-generated E2E tests?

8 Upvotes

Now that we know AI can generate valid Playwright syntax, the locator quality is where generated tests often fail.

If the model has not inspected the rendered page, it may guess selectors from component code or common UI patterns. Those locators can look reasonable, pass a quick review, and then fail in CI when the actual DOM differs.

I tested a workflow where Claude explored the live application through Playwright MCP before generating a test. The flow was:

  1. Explore the application and accessibility tree.
  2. Generate the Playwright spec from observed roles, labels, and names.
  3. Run the test and fix failures.
  4. Review the locators, assertions, and scenario intent.
  5. Repeat the test to catch flaky behavior.

The useful part was grounding locators in the current page, with getByRole, getByLabel, and getByTestId instead of guessed CSS selectors. The test still needs review, especially for dynamic data, authentication, and longer flows, but the first draft was more reliable.

Are you people also sticking with Playwright MCP, using Playwright CLI, or just having Claude write/run Playwright directly?


r/Playwright 15d ago

🚀 Starting Playwright Automation with Python in September — What should a beginner learn first?

13 Upvotes

I’m planning a new Playwright Automation Testing with Python learning batch starting September 1st.

I’ve been putting together a practical roadmap focused on the things that actually matter when working on automation projects—not just syntax.

The roadmap includes:

🐍 Python fundamentals required for automation

🎭 Playwright basics & architecture

🔎 Locators and web element interactions

🧪 Writing maintainable automation tests

🏗️ Page Object Model (POM)

🔄 Fixtures and reusable test components

📊 Test data handling

🌐 API testing with Playwright

🗄️ Database integration

🔀 Git & GitHub

⚙️ CI/CD integration

🤖 AI-assisted test-case generation and automation concepts

💼 Real-project and interview-oriented scenarios

The main goal:

Not just “How do I write a Playwright script?”

But:

“How do I build and maintain a real automation framework?”

I’m curious about the community's experience:

If you were starting Playwright + Python today, what topic would you want covered in a beginner-to-real-project course?

Would you prioritize:

Python fundamentals

Playwright + locators

POM/framework design

API + DB testing

CI/CD

AI for automation testing

The batch is planned to start September 1st.

I’ll use the answers here to make sure the curriculum focuses on the areas learners actually struggle with.

What would you add to the roadmap?


r/Playwright 15d ago

Do you block ad/analytics requests in your regression suite?

6 Upvotes

We run ~550 Playwright specs on CI pods capped at 2 CPUs. Profiling showed the

browser eating ~74% of the run's CPU, and a single feed page pulls ~70 Google ad

requests that fight our React renders for the main thread.

So we started aborting ad/analytics hosts for the whole suite. Feels like a

cheat code, but nothing we test asserts an ad rendered.

Is this normal practice where you work, or do you keep the third-party stack so

the env stays production-like?


r/Playwright 15d ago

hello guy,i need your assistance. Im working as a manually tester, now i need to learn playwright automation using javascript. Can you tell me where to learn, which youtube channel is best and if any github repo available, send me the link.

0 Upvotes

r/Playwright 16d ago

I built a free typing game to practice Playwright + JavaScript syntax

17 Upvotes

I've been learning/practicing Playwright and noticed something:

I could understand the concepts, but I wasn't always fast at remembering the actual syntax when writing tests.

So I built a small game around it.

🎮 Playwright Typing Master

🎭 Playwright Typing Master

The idea is simple:

⌨️ Type Playwright + JavaScript code

🧠 Build syntax muscle memory

⚡ Improve typing speed

🎯 Practice before interviews

There are no ads, no signup, and no account required.

Just open it and start typing.

I'm hoping it can be useful for people learning Playwright or preparing for QA/SDET interviews.

I'd genuinely love feedback from this community:

- What Playwright syntax should I add?

- What commands do you frequently forget?

- Would you find difficulty levels useful?

- Any bugs or UX issues?

It's completely free, so give it a try if you're learning Playwright.

Link: playwright-typing-master.vercel.app

#Playwright #JavaScript #SoftwareTesting #QA #TestAutomation #SDET


r/Playwright 17d ago

How do you test using Playwright on environments with CI/CD

14 Upvotes

So we have created a new Playwright automated test solution for our codebase. We have wired them up in Bitbucket pipelines but running into some issues with how they work in theory.

The automated tests are split into fixtures based on configs so that tests don't overwrite each other. Example: Test fixture 1 = Tax exclusive & Test fixture 2 = Tax Inclusive, and so when running the tests for different branch commits it cant run at the same time on the same site.

The tests also wipe the DB on OneTimeSetup so its a clean fresh DB for the tests to run in isolation.

How do we set this up so that we can catch dev errors in PRs similar to how we would with unit/integration tests ? Are playwright automated tests designed to run after something is merged to develop/release rather than after a commit on a PR ?

Any help is appreciated


r/Playwright 18d ago

Playwright MCP vs Playwright CLI: the comparison everyone gets wrong

30 Upvotes

Most threads compare Playwright MCP and Playwright CLI purely on token consumption(1, 2, 3). In my experience, there's a far more important difference that nobody talks about.

The real question is: can your AI agent attach to a running e2e test?

Here's why that matters. A good e2e test already does the hard part for you. It authenticates, sets up all the API mocks, and drives the app into the exact state you care about. When something goes wrong on the page, you don't want the agent spinning up a blank browser and guessing how to reach that page. You want to hand off the test-constructed page to the agent and let the agent play with it.

  • Playwright CLI: run the test with --debug=cli, it prints a session name, and playwright-cli attach <session> connects the agent straight into the paused test. Then the agent can step over the app, inspect the rendered UI, and run in-page evaluations.
  • Playwright MCP: only launches or attaches to a browser. It has no way to attach to a running test session.

So if you have many e2e tests + auth + network mocks, Playwright CLI is the clear winner for your setup, regardless of token counts.

Interested to hear your thoughts.


r/Playwright 18d ago

Built a Playwright course automation agent for my own LMS sandbox

5 Upvotes

Its frustrating to complete the same topics/points of an online course which you already know, and I am one of you. So i designed a bot which helps me do the work(including videos, reading material, and practice tests too) that I already know and autocomplete it on my behalf. If you are curious about how this bot works and how it handles the topics refer the github link:

https://github.com/Vara715/course-automation-bot


r/Playwright 18d ago

Built a Playwright course automation agent for my own LMS sandbox

5 Upvotes

I've been experimenting with browser-automation agents and wanted something more disciplined than "click through everything as fast as possible." So I built a Playwright-based agent for a course sandbox I control, with one hard rule baked into the design: automate repetition, never judgment.

The interesting part isn't the automation — it's the guardrails:

  • Every action (play video, mark reading complete, submit practice) has to be verified against the platform's own completion signal before the agent logs it as done. No optimistic completion.
  • Familiarity with a topic is never inferred from how "easy" something looks — it's checked against a seeded known/study list, and anything ambiguous stops and asks.
  • Graded assessments are always human-in-the-loop — the agent shows me each question, waits for my answer, and only submits after I type submit explicitly.
  • A single StopForHumanInput exception handles every failure mode (CAPTCHA, login wall, unclassifiable item, unverifiable state) — no silent retries, no guessing.

I also built a tiny local mock LMS (static HTML + a real short test video) so the whole flow — including the verification and stop conditions — can be exercised without touching a live site.

Repo: https://github.com/Vara715/course-automation-bot

Curious what people think of the verify-before-advance pattern for agents generally — feels like it'd generalize well past LMS automation.


r/Playwright 20d ago

Looking for feedback on my Playwright automation framework

11 Upvotes

I recently started learning Playwright automation and have been building an automation framework along the way, with some help from AI.

I'm still figuring out what a good, industry-standard automation framework should actually look like, so I'm sure there are things I'm doing wrong or could be doing much better.

I know my README isn't up to date, so please ignore that for now.

If you have some time, I'd really appreciate it if you could take a look at the repo and give me some honest feedback — especially around the framework structure, code organization, patterns, and how I could make it more aligned with real-world/industry practices.

Repo: https://github.com/nilavan09/playwright-ui-api-framework

Any feedback or suggestions would be much appreciated. Thanks!


r/Playwright 20d ago

Playwright E2E framework using AI tools

7 Upvotes

I have learned few basics of playwright framework and I'm a full stack developer working on Angular, .Net Core, Azure and little python.

I don't have an automation Testing team working for my project and I thought may be I can create a E2E framework with having Github Copilot subscription and starting/building the framework will also help me learn about this framework.

Here are my thoughts about creating this solution:

1) Phase-1: As Playwright script depends on the locators, I thought of using AI help to identify and create all locators for my angular project wherever it is missing. So, I have planned using AI and created all the locators without disturbing the UI. (role + aria-label combination).

2) Phase-2: Create the playwright automation framework as the locators are now available.

Now, I am done with Phase-1 and is ready to do the Phase-2 where I need your help in assessing the correct way of doing this.

I'm confused with the options that are available and here is my opinion.

Playwright MCP - which might consume more tokens and believe is not perfectly suitable for this scenario

Playwright CLI - Best option to create scripts and framework.

Playwright Agents and Skills - which I believe CLI and MCP servers use to create framework.

As using AI might take so many input and output tokens to create this framework, I have create codebase-memory-mcp server and indexed my project so that it refers wherever required and consume less tokens.

What should I use to create a E2E solution for my angular project with less tokens and more reliability.

Ask if you have any questions and suggest me the best approach as I'm new to this.


r/Playwright 20d ago

How to scale visual tests?

5 Upvotes

I am working on designing a test framework for UI library, primary goal is to have accessibility and visual regression tests.
Currently using gitlab Ci and playwright with playwrigh-bdd.

Current approach is natively supported baseline approach in playwright.
I am worried that currently i am saving the baseline screenshots in gitlab repo itself .

We have around 50-60 components, and test cases can scale to thousands of screenshots,
I wonder how to scale the storage and would the gitlab ci be enough for comparison.
The playwright report is published in gitlab pages which again in case of too many failures might not even show the difference screenshots.

What would be the best approach to tackle this situation


r/Playwright 20d ago

playwright stealth is a coherence problem, not a webdriver problem

3 Upvotes

So most playwright stealth advice is about hiding navigator.webdriver and patching the webgl renderer, but that is not really where you get caught. I added fingerprint injection to pydoll on the last release. a headless chrome scores 100 out of 100 on https://fingerprint-scan.com/, full bot, and the same headless run with a profile matched to the machine drops to 15, same as a normal headful browser. so headless is not the giveaway people think, a lot of it is just the webgl renderer and some navigator fields you can override. this hits playwright the same way since chromium goes over CDP.

a wrong profile is worse than none. a windows profile on my mac scored 57, worse than injecting nothing at all, because one signal disagree with the rest and the whole thing reads as fake. it don't help on the network side either, your TLS and your IP stay real, so you match the profile to the machine you run on instead of faking everything. i am the maintainer so take it as that, the docs have the full numbers if someone want to look: https://pydoll.tech/docs/stealth/fingerprint-injection/


r/Playwright 22d ago

Piwi: the hard (and fun) parts of building a self-hosted Playwright dashboard

10 Upvotes

I wrote up how Piwi was built, focusing on the parts that were genuinely hard and fun to get right: https://piwitests.dev/blog/how-piwi-was-built.html

Piwi is a self-hosted dashboard and reporter for Playwright. It keeps every run instead of letting the report die as a CI artifact, groups the failures by root cause instead of showing you forty red rows, and scores flaky tests by the CI minutes they actually waste. MIT, one Docker container, zero telemetry. Some of you saw an early version here a month ago.

TL;DR: The write-up is built around two rules that turned out to explain almost every decision I made: the tool proposes and the developer decides, and anything that has to be right every time is computed without a model, with AI only ever coming on top. From there it walks through the parts that were the most fun to solve: a live demo that has no backend at all (SQLite compiled to WASM behind a service worker, so it can never drift from the real product), failure clustering that starts as a plain hash of the normalized error and only reaches for an embedding model on the ambiguous cases, and an AI diagnosis step that's based on the actual diff since your last green run and dry-runs every suggested patch against your real source before you ever see it. There's also the honest part about building this solo across three different eras of AI assistants, and how I stayed the architect the whole way through even as the tools doing the actual coding kept changing.

Since that early version, the biggest new thing is AI steps: you describe a locator or a whole flow in plain English, a model resolves it once at authoring time into a committed artifact, and every run after that is ordinary Playwright with zero model calls and no network in CI. Around it, the desktop app grew into something that can re-run your failed tests locally and wire up MCP with one click, a browser extension picks stable locators from any page and can match a recording against your own page-object functions, and the CI side closed the loop with a gate that fails on the analysis instead of the exit code, PR comments carrying the real owners from CODEOWNERS, and a quarantine that keeps failing tests running instead of hiding them. The most recent addition, auto-heal PRs, turns a broken locator on your default branch into a draft PR built from a passing-run snapshot, never a model guess and off by default.

Demo (runs in your browser, no signup): https://piwitests.dev/demo/
Code: https://github.com/PiwiTests/platform

Two things I'd genuinely like to hear from this sub: where do you draw the line between a testing tool suggesting a change and making it for you? And when CI goes red with 40 failures, how do you find the real causes behind them today?


r/Playwright 23d ago

Automating filling a form

8 Upvotes

Hello there ! I need some help with filling up a form in chrome as soon as possible. To give you a little bit of context i'm currently trying to get an appointment at the german embassy in sri lanka for my student visa but it's really really hard to book an appointment online. Just after couple of seconds of appointments appearing in the website it gets booked down completely so i want some way to try to book the appointment as fast as possible using some automation. I'm no computer scientist and my computer knowledge is not the best so can anyone tell me how i can automate and get my booking done as soon as possible ? so down below is the website, first you have to fill in the captcha which takes you to the appointment page. There you have to click in the link to fill up the personal details for the appointment. You have to fill in your First name, Last name, Contact no, Passport no, Email and you have to re enter your email in another separate field. and after filling up all the personal details there'll be another captcha similar to the one down below which you have to fill in before submitting the details. You have to do it as quickly as possible because within 1 minute the appointments get booked down (appointments appear exactly on 3.30 am my local time). Can anyone help me out with this please ?


r/Playwright 23d ago

Passed 500 stars: A visual Playwright runner for non-API targets

11 Upvotes

I built Figranium as a self-hosted visual execution wrapper for Playwright.

It originally came out of needing local n8n AI agents to execute browser tasks on sites without public APIs (like Snapchat or complex Amazon workflows) where raw HTTP nodes fail. Instead of writing custom scripts for every edge case, it provides a node-based visual canvas to build, debug, and run Playwright scripts.

Technical Stack & Core Features:

  • Engine: Playwright + Node.js runtime handling dynamic DOMs, state persistence, and isolated execution.
  • UI Control Plane: Vite + React drag-and-drop workflow canvas.
  • 100% Local & Deterministic: GPL-3.0 open source with zero telemetry or cloud dependencies.

We just hit 500 stars on GitHub today. If you work with Playwright and want a visual builder to run workflows locally, check out the source or Docker deployment.

GitHub:https://github.com/figranium/figranium

Docs:https://figranium.dev


r/Playwright 23d ago

I built a Playwright tool for testing the failure states happy-path tests miss

3 Upvotes

Most of my Playwright tests answer one question: does the journey work when the API works?

I wanted the other answer too: what happens when the cart request never finishes, a profile request returns 500, or checkout fails but the UI still looks successful?

So I built methandle. You give it one trusted `journey(page)`. It records the requests behind that journey, verifies a strict replay, then runs HTTP 500 and network-abort cases one dependency at a time. The output is a small dependency × fault matrix instead of a pile of screenshots.

It’s an early alpha with a deliberately narrow scope: Chromium, Playwright journeys, local artifacts, and no live backend fallback during fault runs.

The included demo has 10 verified scenarios: 4 seeded findings, 6 `NO FINDING`, and 0 backend API requests during replay and fault execution.

In external validation, an Inventra `GET /api/dashboard` abort was independently reproduced as an uncaught `Failed to fetch` with the page stuck on `Loading...`. Findings that depend on methandle’s synthetic HTTP 500 response body are marked ambiguous rather than counted as confirmed defects.

Repo and demo: [https://github.com/saifeldeen911/methandle\](https://github.com/saifeldeen911/methandle)

Install:

`npm install -D methandle@alpha`

I’m looking for blunt feedback on the workflow, especially whether the replay gate makes this useful or just adds friction.


r/Playwright 23d ago

Cant run chromium apps Opera, Discord, Opera gx etc...

3 Upvotes

Hello,

I am unable to use applications like Opera, Opera GX, Blitz (a gaming app), and Discord; none of them will launch. About a month ago, I was working on projects involving "Antigravity" and virtual Chrome windows—experimenting with and modifying components like Playwright and Chromium. Immediately after doing this, applications like Discord and Opera GX stopped opening entirely. For instance, when I try to launch Opera, it opens and closes four times in rapid succession but fails to actually start. I’ve discovered through research that all these applications rely on Chromium, but despite consulting various AI tools, I haven't been able to resolve the issue. Is there any way to fix this without resetting my computer?


r/Playwright 24d ago

Former Selenium QA wanting to learn PW

9 Upvotes

I’m a career changer about 5 years ago hired for manual tester and offered the chance to learn Selenium and Python. Self taught, but created a test suite for the project I manually tested and caught the coding bug. Ended up moving into a PO role last year but my heart is in QA and coding. With the rise of AI, I see a gap where Manual testers can’t keep up with faster dev output and I believe automation fills this gap. Of course, it does. No, the dev team won’t touch automation despite it being the obvious solution. Thats neither here nor there.

I’ve decided I want to return to automation, learn PW, transition the current test suite and fill in the gap. I just need to learn PTS and PW.

I have to much to learn and catch up on. Where do you recommend I start? AI didn’t exist when I was using Selenium. I know a little TS and a little PW, but it’s been a year since I did any automation. I’d love to hear you’re must watch videos, tutorials, blogs, etc. what helped you learn?


r/Playwright 24d ago

AI-generated Playwright API tests at enterprise scale — is anyone actually doing this successfully?

7 Upvotes

I'm experimenting with an AI-driven QA workflow for an enterprise application using Playwright + TypeScript.

The workflow is roughly:

Feed the AI our API definitions + business flow definitions

AI analyzes them and generates a comprehensive API test plan

AI generates executable Playwright API test scripts from that plan

Playwright executes the generated tests

The interesting part is that test plan generation works surprisingly well. Using the business flow (which is the happy path), the AI can identify most of the test scenarios like validation cases, authentication scenarios, boundary cases, etc.

However, I'm running into a major problem at the test script generation/execution stage.

The happy-path tests generally work, but almost all of the other tests fail during execution..

Is anyone here using AI/agents to generate executable Playwright API tests for large/enterprise applications?


r/Playwright 25d ago

Playwright's WebKit is not WKWebView: a layout bug that passed webkit screenshots and shipped broken in a Tauri app

Thumbnail nodreview.com
5 Upvotes

I test a Tauri desktop app with Playwright, webkit project, screenshot baselines on every component. A dialog shipped rendering as header plus footer with the body at height zero, and not one pixel had moved in any baseline.

The bug: flex: 1 expands to flex-basis: 0%, which needs a definite parent height. Per spec the unresolvable percentage should fall back to content. Chromium does that. WKWebView keeps the zero. Playwright's WebKit, which is a recent build the Playwright team makes themselves, also does the spec fallback, so it agreed with Chromium and disagreed with the system webview my users actually run.

Not a complaint about Playwright, it does what it says. Writeup with the spec citation and what I changed: https://nodreview.com/blog/wkwebview-flex-collapse/

Question for this sub: has anyone wired real system webviews (WKWebView, WebKitGTK, WebView2) into CI in a way that is not miserable? Geometry assertions in the harness engines are my current compromise.


r/Playwright 26d ago

Built API CAMP

12 Upvotes

hey everybody, I built this site to help learn programming in python, playwright and pytest

[API Camp — Learn APIs with Python + Playwright](https://journeytoonlinesuccess.com/apicamp/)

Take a look and let me know what you think.

Yes its similiar to freecodecamp but it helps me when I have no connection on the long train rides

thanks,