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

Selenium (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 Selenium with Java
- Available study time per day: [30 mins / 1 hour / 2 hours]

Create a structured 10-12-week learning roadmap covering:
1. Java fundamentals for testers (only what I need)
2. Selenium 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: Java Basics โ€” Only What You Need for Selenium

You are a Java instructor teaching a manual QA engineer with zero coding background.

Teach me only the Java I need to write Selenium tests. No theory โ€” only practical.

Cover in order, one example each:
1. Variables and data types (String, int, boolean)
2. Methods โ€” how to define and call them
3. Classes and objects โ€” for Page Object Model later
4. If/else statements
5. For loops and while loops
6. Exception handling โ€” try/catch/finally (critical for Selenium)
7. Imports and packages

Rules:
- Use QA/testing analogies throughout
- One short explanation + one code example per concept
- After each concept ask: 'Do you want a practice task?'
- All code examples must relate to web testing scenarios

Start with variables. Wait for me to say 'next' before continuing.

Prompt 2B-1: How Selenium Works โ€” Architecture Explained Simply

You are an expert Selenium Java trainer.

Explain how Selenium WebDriver works under the hood to a manual QA engineer.

Cover:
1. What WebDriver is and how it communicates with browsers
2. Why ChromeDriver/GeckoDriver are needed โ€” and WebDriverManager removes this pain
3. The W3C WebDriver protocol โ€” explain simply without jargon
4. Why explicit waits are critical and what happens without them
5. The most common types of test failures in Selenium and why they happen

After each concept, give one interview Q&A.
Format: Concept โ†’ Explanation โ†’ Interview Q&A

Prompt 2B-2: Locator Strategies Masterclass

You are a Selenium Java locator expert.

Teach me every locator strategy in Selenium WebDriver with Java.

For each locator: what it is, when to use it, code example, when NOT to use it.

Cover in order (best to fallback):
1. ID โ€” why it is the best when available
2. Name
3. CSS Selector โ€” how to write effective ones, common patterns
4. XPath โ€” absolute vs relative, writing robust XPath
5. Class Name, Link Text, Partial Link Text, Tag Name

End with:
- A locator decision tree in text format
- Top 3 locator mistakes Selenium Java beginners make
- How to find locators in Chrome DevTools

Prompt 2B-3: Waits in Selenium โ€” The Complete Guide

You are an expert Selenium trainer.

Teach me everything about waits in Selenium Java. This is the most common failure source.

Cover:
1. Implicit wait โ€” how it works, how to set it, its limitations
2. Explicit wait โ€” WebDriverWait + ExpectedConditions
   Show top 5 ExpectedConditions with real code examples
3. Fluent wait โ€” what it adds over explicit wait
4. Thread.sleep โ€” why it is bad, when if ever acceptable

For each scenario show WRONG way then CORRECT way:
- Wait for a button to be clickable
- Wait for an element to disappear
- Wait for text to change
- Wait for an AJAX call to complete

End with: top 5 reasons Selenium tests pass locally but fail in CI.

Prompt 3A-1: Your First Selenium Test Step by Step

You are a Selenium Java trainer teaching a manual QA engineer.

Guide me through writing my very first Selenium Java test from scratch.
Use https://the-internet.herokuapp.com/login as the test site.

Walk through every step:
Step 1: Maven project setup โ€” pom.xml with all dependencies
Step 2: Complete test file with every line explained
Step 3: Each Selenium method used (get, findElement, sendKeys, click)
Step 4: How to run from IntelliJ and from command line
Step 5: What passing and failing output looks like

After the working test, give me 3 variations to try myself:
- Test with wrong password
- Test that error message is correct
- Test that successful login shows correct page title

Do not give me the answers โ€” let me try first. Tell me to come back if stuck.

Prompt 3B-1: AI-Assisted Code Writing

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

I will describe a test scenario in plain English.
You will: write the complete Selenium Java test, explain every line,
point out edge cases I should also test, suggest improvements.

My scenario: [DESCRIBE YOUR SCENARIO HERE IN PLAIN ENGLISH]
Example: 'Test that a user can add to cart, update quantity to 3,
and see correct total on the checkout page.'

Use https://www.saucedemo.com if I do not specify a site.

After writing the test, ask me:
- Do I want negative test cases added?
- Do I want this refactored into Page Object Model?
- Do I want data-driven variations?

Prompt 3B-2: Debug My Failing Selenium Test

You are an expert Selenium Java debugger.

My test is failing. Help me debug it.

Here is my failing code:
[PASTE YOUR FAILING TEST CODE HERE]

Here is the error message:
[PASTE THE ERROR MESSAGE HERE]

Please:
1. Identify what is causing the failure
2. Explain why this error happens in Selenium Java
3. Show me the corrected code
4. Tell me how to avoid this error in future
5. Suggest one defensive practice to add

Build A Full Selenium Java Framework

Prompt 4-1: Design Your Framework Architecture

You are a Principal SDET with deep Selenium Java expertise.

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

Cover:
1. Maven project folder structure โ€” show the exact tree
2. pom.xml dependencies โ€” Selenium, TestNG, WebDriverManager, ExtentReports
3. Page Object Model design โ€” BasePage class + example LoginPage
4. TestNG configuration โ€” testng.xml for parallel execution
5. config.properties for multi-environment support
6. ExtentReports for HTML test reporting
7. Maven Surefire Plugin configuration

Show complete folder tree. Explain every file and folder.
Top 3 Selenium Java framework mistakes beginners make?

Prompt 4-2: Build Page Object Model

You are a Selenium Java POM expert.

Build a complete POM implementation for a login + dashboard flow.

Step 1: BasePage class with common WebDriver methods
Step 2: LoginPage with PageFactory and @FindBy annotations
Step 3: DashboardPage class
Step 4: TestNG test class using both page objects
Step 5: Why POM makes maintenance easier โ€” concrete locator change example

Show all code with comments. Give me a practice exercise at the end.

Prompt 4-3: Parallel Execution and Cross-Browser Testing

You are a Selenium Java parallel execution expert.

Teach me parallel cross-browser execution in Selenium Java with TestNG.

Cover:
1. testng.xml parallel configuration for Chrome and Firefox
2. ThreadLocal<WebDriver> โ€” why it is critical for parallel safety
3. DriverManager class implementation
4. Passing browser parameter from testng.xml to tests
5. Selenium Grid basics โ€” what it is and when to use it

Show complete working code for all components.
Top 3 reasons parallel tests fail?

Prompt 4-4: CI/CD Integration

You are a DevOps and Selenium Java expert.

Show me how to integrate my Selenium Java Maven project with CI/CD.

Option 1 โ€” GitHub Actions:
Complete .github/workflows/selenium.yml
Install Java, Maven, Chrome. Run tests headless. Upload report.

Option 2 โ€” Jenkins:
Declarative Jenkinsfile. Maven build. Publish HTML report. Email on failure.

Explain headless mode โ€” what it is and why CI runs tests headless.
Top 5 CI failure reasons for Selenium Java tests.

Show all code with comments.

Interview Preparation

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

You are a senior SDET interviewer at a product company.

Conduct a mock Selenium 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 Selenium 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 Selenium 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 Selenium 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 Selenium 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 Selenium? Browse the kits โ†’

Want new prompt kits in your inbox?

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