โ† All prompt kits
Free ยท 16 copy-paste prompts

Playwright (Java) โ€” AI Prompt Kit

Copy each prompt and paste it into ChatGPT or Claude. Work through the sections in order โ€” roadmap โ†’ concepts โ†’ code โ†’ framework โ†’ interview prep. Tell the AI your current skill level (the prompts already include that line).

Your Learning Roadmap

ROADMAP PROMPT โ€” Run this first

You are an expert SDET trainer with 15 years of experience.

I am a manual QA engineer transitioning into automation. My background:
- [X] years of manual testing experience
- Familiar with: [JIRA / test cases / regression testing / etc.]
- Programming knowledge: [none / basic / intermediate]
- Goal: become job-ready using Playwright with Java
- Available study time per day: [30 mins / 1 hour / 2 hours]

Create a structured 8-10-week learning roadmap covering:
1. Java fundamentals for testers (only what I need)
2. Playwright with Java core concepts and architecture
3. Writing my first tests
4. Framework design and best practices
5. CI/CD integration
6. Interview preparation
7. AI concepts in testing for 2025/2026

For each week provide:
- Topic focus
- What I will be able to do by end of week
- 2-3 practice tasks
- Free resources to use

Format as a clean table then a detailed week-by-week breakdown.
Adjust timeline based on my daily study time.
Be specific โ€” this is my actual study plan, not a generic template.

Learn Concepts From Scratch

Prompt 2A-1: Key Differences โ€” Selenium Java to Playwright Java

You are a senior SDET expert in both Selenium Java and Playwright Java.

I know Selenium Java. Teach me Playwright Java by contrast.
For each concept show: Selenium Java way โ†’ Playwright Java way

1. Browser launch โ€” no more ChromeDriver setup
2. Finding elements โ€” Locator vs findElement + By
3. Waits โ€” auto-waiting vs manual explicit waits
4. Assertions โ€” Playwright Assertions vs TestNG/JUnit assertions
5. Screenshots and videos โ€” built-in vs third-party
6. Page Object Model โ€” what changes in Playwright Java
7. Maven dependency โ€” what to add to pom.xml

For each: show Selenium Java code first, then Playwright Java equivalent.
Highlight what is better and what is different in Playwright.

Prompt 2B-1: Playwright Java Setup and First Test

You are a Playwright Java expert.

Walk me through setting up Playwright Java from scratch.

Step 1: Maven project setup โ€” pom.xml with playwright dependency
Step 2: Install Playwright browsers โ€” the Java way
Step 3: First test โ€” Playwright vs Selenium syntax comparison
Step 4: Run with Maven from terminal
Step 5: HTML report with Playwright trace viewer

Show complete pom.xml and first test file.
Comment every line. What would this test look like in Selenium? Compare.

Prompt 2B-2: Playwright Java Locators and Assertions

You are a Playwright Java trainer.

Teach me locators and assertions in Playwright Java.

LOCATORS:
- page.getByRole(), getByText(), getByLabel(), getByTestId()
- How these work in Java syntax
- Why these are better than CSS/XPath for maintenance
- When to still use CSS selectors

ASSERTIONS โ€” Playwright Assertions:
- assertThat(locator).isVisible()
- assertThat(locator).hasText()
- assertThat(page).hasURL()
- assertThat(locator).isEnabled()

Show Java syntax for each. Compare to TestNG/JUnit assertions.
Why are Playwright assertions better for UI testing?

Prompt 2B-3: playwright.config equivalent in Java

You are a Playwright Java expert.

In TypeScript we have playwright.config.ts.
In Java, configuration is done differently. Teach me how.

Cover:
1. Browser launch options in Java (headless, viewport, timeout)
2. BrowserContext options (baseURL, storageState)
3. How to manage configuration for multiple environments in Java
4. TestNG xml for cross-browser parallel execution with Playwright Java
5. How to generate Allure or ExtentReport with Playwright Java

Show complete Java configuration setup.
Compare complexity vs playwright.config.ts.

Prompt 3A-1: AI-Assisted Playwright Java Code Writing

You are a senior Playwright Java SDET acting as my coding partner.

I will describe a scenario in plain English.
Write the complete Playwright Java test, explain every line,
point out edge cases, suggest improvements.

My scenario: [DESCRIBE YOUR SCENARIO HERE]
Use https://www.saucedemo.com if I do not specify a site.

After writing, ask:
- Do I want negative test cases?
- Do I want this converted to Page Object Model?
- Do I want TestNG data-driven variations?

Prompt 3B-1: Debug My Failing Playwright Java Test

You are an expert Playwright Java debugger.
Failing code: [PASTE HERE]
Error: [PASTE HERE]
Identify cause, explain why, show fix, prevent in future.
Trace Viewer tip: how would I use Playwright Trace Viewer to debug this?

Build A Full Playwright Java Framework

Prompt 4-1: Framework Architecture

You are a Principal SDET expert in Playwright Java.

Guide me through building a production-ready Playwright Java Maven framework.

Cover:
1. Maven project folder structure โ€” exact tree
2. pom.xml โ€” Playwright + TestNG + Allure dependencies
3. Page Object Model in Playwright Java
4. ThreadLocal for parallel-safe Page instances
5. TestNG parallel configuration
6. Allure reporting integration
7. GitHub Actions CI/CD

Show complete structure. Explain every file.
Top 3 Playwright Java framework mistakes?

Prompt 4-2: POM in Playwright Java

You are a Playwright Java POM expert.

Build a complete POM for login + dashboard in Playwright Java.

Step 1: BasePage class with common Playwright methods
Step 2: LoginPage with Playwright locators (no PageFactory)
Step 3: DashboardPage
Step 4: TestNG test using both pages
Step 5: Why no PageFactory is needed in Playwright Java โ€” lazy locators

Show all code with comments.
Compare this POM to Selenium Java POM โ€” what is simpler in Playwright?

Prompt 4-3: Tracing and Debugging in Playwright Java

You are a Playwright Java debugging expert.

Teach me all debugging and tracing capabilities in Playwright Java.

Cover:
1. Playwright Trace Viewer โ€” how to enable and use
2. Screenshots on failure โ€” how to configure in Java
3. Video recording โ€” configuration and use case
4. Headed vs headless mode for debugging
5. Console log capture in Playwright Java
6. How to debug tests that fail in CI but pass locally

Show complete configuration for all debugging features.
The key line: what makes Playwright Trace Viewer irreplaceable?

Interview Preparation

Prompt 5-1: Mock Interview โ€” Junior Level

You are a senior SDET interviewer at a product company.

Conduct a mock Playwright Java interview with me at junior SDET level.

Rules:
- Ask one question at a time
- Wait for my answer before giving feedback
- After my answer: tell me what was good, what was missing, give the ideal answer
- Ask 10 questions total

Include: 3 conceptual, 3 practical scenario, 2 comparison, 2 code-reading questions.

Start now. Ask your first question.

Prompt 5-2: Mock Interview โ€” Senior SDET Level

You are a Principal Engineer interviewing for a Senior SDET role.

Conduct a senior-level Playwright Java mock interview.

Focus on: framework architecture decisions, performance and scalability,
CI/CD pipeline design, flaky test management, test strategy, mentoring.

Rules: one question at a time, wait for answer, give structured feedback.
8 questions total. Begin.

Prompt 5-3: Salary Negotiation for Automation Roles in India

You are a career coach specialising in QA and SDET roles in India.

I am transitioning to automation using Playwright Java and preparing for interviews.

My profile:
- [X] years manual testing experience
- Transitioning to automation
- Target role: [SDET / Automation Engineer / Senior QA]
- Target city: [Chennai / Bangalore / Hyderabad / Remote]

Provide:
1. Current market salary range for my profile in India (2025/2026 data)
2. Exact words to say when asked for expected CTC
3. How to handle an offer below my expectation
4. What NOT to say in salary discussions
5. How to negotiate when moving from manual to automation roles

AI Concepts And AI-Assisted Testing

Prompt 6-1: AI in Testing โ€” Interview Answer Framework

You are an expert on AI in software testing.

Teach me how to answer AI-related questions in a Playwright Java SDET interview.

Cover these with ideal interview answers:
1. How is AI changing test automation in 2025/2026?
2. How do you use AI tools like ChatGPT or Claude in daily testing work?
3. What is visual AI testing and which tools support it?
4. How would you test an AI-powered feature as an SDET?
5. What is self-healing test automation and how does it work?

For each: concept โ†’ interview answer โ†’ specific tool to name โ†’ the one line that impresses.
Format: Question โ†’ Concept โ†’ Answer โ†’ Key Line

Prompt 6-2: Generate Tests from Requirements Using AI

You are a senior SDET who uses AI daily in Playwright Java workflows.

Teach me to generate tests from user stories using AI.

Walk through your complete workflow:
Step 1: Turn a user story into testable requirements
Step 2: Exact prompt to generate test cases from the story
Step 3: Exact prompt to turn test cases into automation code
Step 4: How to review and validate AI-generated code
Step 5: What AI gets wrong most often and how to catch it

Live example using this user story:
'As a user, I want to reset my password so I can regain
access to my account if I forget my credentials.'

Show: user story โ†’ test cases โ†’ automation code.
Then ask me to try with a story of my own.

Prompt 6-3: Build Your AI-Assisted Daily Testing Workflow

You are a senior SDET who integrates AI into daily work.

Build a practical AI-assisted workflow for my daily testing tasks.

Cover:
1. Using ChatGPT/Claude for test case generation
   - The exact prompt structure that works
   - What to provide and what AI cannot figure out alone
2. Using AI for professional bug report writing from rough notes
3. Using AI for test data generation
4. Using AI for automation code review โ€” finding anti-patterns
5. The daily AI habits of a productive SDET in 2025

End with: the one AI skill every QA engineer should master first.

Want the matching interview Q&A and coding kits for Playwright? Browse the kits โ†’

Want new prompt kits in your inbox?

Get new prompt kits, QA resources, and guides as they drop. No spam.