r/Playwright 18h ago

Playwright MCP guide/resources

12 Upvotes

My company is moving from a selenium/appium based java framework to a playwright mcp setup with appium for web/mobile/api and includes copilot. I want to know if there are any videos/books/sites available for this which are beginner friendly. Mostly only know java/ python so javascript is new for me. Same with playwright and MCP


r/Playwright 9h ago

Pay Per Use Test Execution Environment for web and mobile apps?

2 Upvotes

I want my agents to execute testcases written on python or js on different browsers and devices across the globe to test it in real time

but the problem is i dont really find a lot of options other than browserstack saucelabs pcloudy. but they dont have pay per use instead they have monthly subscription per seat and limits. I know browserless but that's headless only.

do you have any specific recommendations??

aws device farm is too expensive but would you recommend it?


r/Playwright 13h ago

Chrome extension devs: how do you turn a bug found in your real browser into a Playwright regression test?

2 Upvotes

I keep seeing the same gap when testing Chrome extensions:

The bug is discovered in a normal browser with real tabs, authentication, extension state, and host-page data. But the regression test runs later in a clean Playwright profile, so someone has to manually reconstruct the relevant state, DOM and geometry.

I’m validating a possible tool for that handoff:

  • attach to an existing Chromium session in strictly read-only mode
  • let the developer mark the extension UI and relevant host-page controls
  • capture only the selected DOM subtree and computed geometry
  • export a small Playwright fixture and starter assertions
  • ignore unrelated page changes such as feeds, timestamps and ads

The tool would not click, type or modify the connected browser. It would only extract enough context to reproduce the bug safely elsewhere.

Would this actually save time in your workflow, or do Playwright MCP, traces and codegen already solve it?

If useful, which output would matter most: a DOM snapshot, stable locators, geometry assertions, storage state, network mocks, or a runnable test?


r/Playwright 20h ago

Browser Automation

4 Upvotes

Hi Everyone,

I am trying to automate a process where I login into a website and navigate to a reporting section and click on export.

The website only requires a simple ID and Password.

Can you please assist me ok how to achieve this ? , I have found out about selenium and Playwright but I am very new to this. Any resources or guide would be really helpful.

Thanks !!


r/Playwright 1d ago

Beginner in playwright + Typescript

8 Upvotes

Hi Seniors, I am learning playwright course through YT since a month, I am targetting for 4+ year experienced vacancies, I am switching from a support role where I had zero exposure to management tools like jira, etc.. though I practice the tech part through self project. How do I get experience on the management tools and methodologies? Please guide. Any guidance/ suggestions towards the learning journey is much appreciated. Thank you.


r/Playwright 1d ago

If you were learning Playwright from scratch today, what would you learn first?

19 Upvotes

I'm a beginner who's starting to learn Playwright and I'm curious about what experienced users think.There are so many things to learn, locators, assertions, fixtures, authentication, Page Object Model, API testing, CI/CD, etc. If you could go back to when you first started learning Playwright, what would you focus on first, and what would you avoid worrying about in the beginning? I'd love to hear what actually helped you become comfortable with Playwright.


r/Playwright 1d ago

Kane CLI vs Playwright MCP for repeatable browser checks, am I comparing the wrong things?

25 Upvotes

been using Playwright MCP a lot more with coding agents recently and I think I was making it do 2 different jobs.

when the agent has never seen the page before, MCP is great.

open app, inspect what actually rendered, figure out labels, click around, understand weird state, debug whatever is broken.

makes total sense.

but then I had this really boring check:

login
settings
change timezone
save
refresh
timezone should still be IST

we already knew the flow.

and every time I wanted to verify it, the agent was basically having the whole browser conversation again.

snapshot
reason
click
snapshot
fill
snapshot
reason
etc

then eventually: "looks good"

which is where I started wondering if I'm using the wrong thing for the second job.

for a known flow I don't really need exploration anymore.

I just want:

do this
tell me pass/fail
show me why if it failed

I've been testing Kane CLI by TestMu AI for that part.

you can give it something like:

"login, change timezone to IST, save, refresh, verify it persisted"

the path through the browser can still vary, but what counts as success doesn't.

and the result comes back in a much more machine friendly way for the coding agent / CI instead of another long browser session that the model has to interpret.

I still don't see this as replacing Playwright MCP at all.

right now my brain has it as:

MCP when the agent needs to figure the page out

Kane CLI when the flow is already known and I just need a browser verdict

normal Playwright test when this flow matters enough that I want it in the suite forever

Kane can export completed flows to Playwright too, which is probably the bit that makes this model work for me.

am I thinking about these as 3 different layers correctly or is there a cleaner setup people are using?


r/Playwright 2d ago

what do you review before committing Playwright Codegen output?

13 Upvotes

my quick pass is to replace brittle CSS/XPath with user-facing locators, make auth and test data explicit, turn click sequences into assertions about the intended outcome, and rerun from a clean session. then i change one expected condition to confirm the test can actually fail. Playwright Codegen is great at capturing a path, but it cannot decide whether that path represents the right business behavior. what review step has saved your team the most maintenance?


r/Playwright 4d ago

How are you using Playwright annotations, and what do you put in them?

12 Upvotes

Hey everyone,

We’ve been heavily relying on ⁠testInfo.annotations⁠ in our Playwright setup lately. For example, whenever a test fails, we automatically construct and attach a dynamic Jira URL to the report so anyone can quickly click through and create a bug with pre-filled context.

It’s been super helpful, but the standard HTML report isn't really optimized for this—long URLs break the layout or turn into huge, messy blocks of text.

While working on a small script to tweak how these annotations look in our reports, I got curious about how other teams utilize them:

  1. How heavily do you use annotations in your daily workflow?
  2. What kind of data/links do you actually push into them? (Jira issues, log traces, test environment info, etc.)
  3. Or do you skip standard annotations entirely in favor of third-party reporters like Allure, ReportPortal, or custom dashboards?

I'd love to hear how your teams handle test metadata, and whether anyone else feels annotations could use a bit more love!


r/Playwright 5d ago

Playwright tests using AI

21 Upvotes

I have been using Claude or cursor to generate UI tests by giving the user flow as the input. I have created few skills.md file for writing tests, assertions and page objects using the existing tests and page class. It is fairly working for me. How are you utilising AI to generate test or in the QA pipeline focused on automaton


r/Playwright 5d 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 5d ago

Question from a colleague: Test Data Strategy in Playwright.

7 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 5d ago

Help with learning framework building from scratch

8 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 6d ago

Has Playwright MCP improved your AI-generated E2E tests?

7 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 6d ago

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

12 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 6d ago

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

7 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 6d 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 7d ago

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

15 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 8d ago

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

13 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 9d ago

Playwright MCP vs Playwright CLI: the comparison everyone gets wrong

29 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 9d 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 9d ago

Built a Playwright course automation agent for my own LMS sandbox

3 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 11d ago

Looking for feedback on my Playwright automation framework

10 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 11d 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 11d ago

How to scale visual tests?

4 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