How to use this list: Interviewers care less about memorised definitions and more about whether you can explain why. For each answer, prepare a short example from your own project. If your interview is Playwright-specific, also go through our 50+ Playwright interview questions.
These software testing automation interview questions are tool-agnostic, so they apply whether the role uses Selenium, Playwright or Cypress. They cover the topics that come up for automation testers, QA engineers and SDETs — from freshers to experienced candidates.
Automation Fundamentals (Q1–8)
1. What is test automation?
Using code or tools to execute tests, compare actual results with expected results and report outcomes without manual effort. It is most valuable for repetitive checks such as regression suites, smoke tests and data-driven scenarios.
2. Which test cases should you automate?
Stable, repetitive, high-value cases: regression, smoke, data-driven, cross-browser and anything run on every build. Avoid automating one-off tests, rapidly changing features, and checks that need human judgement such as usability or exploratory testing.
3. What are the benefits and limitations of automation?
Benefits: speed, repeatability, wider coverage, fast feedback in CI and freeing testers for exploratory work. Limitations: upfront cost, maintenance effort, flaky tests if poorly designed, and it only checks what you tell it to check.
4. Explain the test automation pyramid.
Many fast unit tests at the base, fewer integration/API tests in the middle, and a small number of slow end-to-end UI tests at the top. It keeps suites fast and stable while still covering real user journeys.
5. What is the difference between manual and automation testing?
Manual testing relies on a person executing steps and observing results; it excels at exploratory and usability testing. Automation runs scripted checks by code; it excels at repetitive, regression and high-volume checks.
6. What is regression testing and why automate it?
Re-testing existing functionality after changes to make sure nothing broke. It is repeated on every release, which makes it the classic automation candidate. See our regression testing guide.
7. How do you measure automation ROI?
Compare time saved per run multiplied by run frequency against build and maintenance cost. Also track defects caught before release, feedback time in CI and the percentage of flaky failures.
8. What is a smoke suite?
A small set of critical tests (login, key pages, core transaction) run first on every build to decide whether deeper testing is worthwhile.
Framework Design (Q9–16)
9. What is a test automation framework?
A set of guidelines, structure, libraries and utilities for creating and running automated tests consistently — covering folder structure, test data, configuration, reporting and reusable components. See automation framework types.
10. What types of automation frameworks are there?
Linear (record-and-playback), modular, data-driven, keyword-driven, hybrid and behaviour-driven (BDD). Most real projects use a hybrid, often built around the Page Object Model.
11. What is the Page Object Model?
A design pattern where each page or component is represented by a class that holds its locators and actions. Tests call those methods instead of using raw locators, so a UI change is fixed in one place.
12. What is data-driven testing?
Running the same test logic with multiple data sets from an external source such as JSON, CSV, Excel or a database, separating test data from test code.
13. What is keyword-driven testing?
Tests are written as sequences of keywords (for example "login", "addToCart") mapped to code, so non-programmers can compose tests from a keyword table.
14. What is BDD and where does Cucumber fit?
Behaviour-driven development describes behaviour in plain-language Given/When/Then scenarios. Cucumber parses those Gherkin files and maps each step to code, improving collaboration between QA, developers and business.
15. How do you manage test data?
Keep it out of test code, generate unique data per test where possible, use APIs or database seeding for setup, clean up after tests, and never depend on data created by another test.
16. How do you handle multiple environments?
Store base URLs, credentials and settings in environment-specific config files or environment variables, select them at runtime, and keep secrets in the CI secret store rather than the repository.
class LoginPage { constructor(page) { this.page = page; this.email = page.getByLabel('Email'); this.password = page.getByLabel('Password'); this.submit = page.getByRole('button', { name: 'Sign in' }); } async login(user, pass) { await this.email.fill(user); await this.password.fill(pass); await this.submit.click(); } }
Locators, Waits & Tools (Q17–24)
17. What makes a good locator?
One that is unique, stable and tied to what the user sees or to a dedicated test id — for example role and accessible name, label text or a data-testid — rather than long, brittle CSS or XPath chains.
18. CSS selector vs XPath?
CSS is usually faster and more readable; XPath can traverse up the DOM and match on text. Modern frameworks prefer user-facing locators such as Playwright’s getByRole over both.
19. Implicit vs explicit waits?
An implicit wait sets a global timeout for finding elements; an explicit wait waits for a specific condition on a specific element. Mixing them in Selenium causes unpredictable timing. Playwright auto-waits for actionability, reducing the need for both.
20. Why is Thread.sleep or a hard wait bad practice?
It always waits the full time even when the app is ready, slowing suites, and still fails when the app is slower than the guess. Wait for conditions instead.
21. Selenium vs Playwright: key differences?
Selenium uses the WebDriver protocol with broad language support and a huge ecosystem. Playwright talks to browsers directly, auto-waits, includes a test runner, parallelism, API testing and tracing out of the box. See Playwright vs Selenium.
22. How do you handle iframes, new tabs and alerts?
Switch context to the frame, tab or dialog before interacting. In Playwright use frameLocator, listen for the popup or page event, and register a dialog handler.
23. How do you automate file upload and download?
Upload by setting the file on the input element; download by waiting for the download event and saving or asserting on the file, rather than driving the OS file dialog.
24. How do you run tests across browsers?
Configure the framework to run the same suite against multiple browsers (Chromium, Firefox, WebKit in Playwright) locally or on a cloud grid, usually in parallel in CI.
API & Back-End Automation (Q25–29)
25. Why automate API tests as well as UI tests?
API tests are faster, more stable and pinpoint failures closer to the source. They also make UI tests faster by creating data or logging in through the API.
26. What do you validate in an API test?
Status code, response body and schema, headers, response time, error handling for invalid input, and side effects such as database changes.
27. Explain common HTTP status codes.
200 OK, 201 Created, 204 No Content, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 409 Conflict and 500 Internal Server Error.
28. Which tools do you use for API automation?
Postman with Newman, REST Assured for Java, and Playwright’s request fixture for mixing API and UI in one suite. See the Playwright API testing guide.
29. How do you test authentication in automation?
Log in once via API or UI, save the session or token, and reuse it across tests — for example Playwright’s storage state — while keeping dedicated tests for the login flow itself.
CI/CD, Reporting & Flaky Tests (Q30–35)
30. How do you integrate automation into CI/CD?
Store tests in the same repository, run them headlessly on every push or pull request with GitHub Actions, Jenkins or GitLab CI, publish reports and artifacts, and fail the build on test failures.
31. What is parallel execution and what does it require?
Running tests simultaneously across workers to cut run time. Tests must be independent: no shared state, unique data, and no reliance on execution order.
32. What is a flaky test and how do you fix it?
A test that passes and fails without code changes. Common causes are timing, shared data, test order and unstable environments. Fix the cause — condition-based waits, isolated data, stable locators — rather than adding retries. See fixing flaky tests.
33. Should you use retries?
Retries can reduce noise in CI, but they hide real problems if overused. Track retried tests and treat them as defects to fix.
34. What do you include in a test report?
Pass/fail counts, failure messages, screenshots, videos or traces for failures, duration, environment and build details, and trends over time.
35. How do you debug a test that fails only in CI?
Reproduce with the same browser, headless mode, viewport and data; collect traces, screenshots and logs from the CI run; and check for timing, environment and resource differences.
AI-Assisted Testing & Scenarios (Q36–40)
36. How can AI help with test automation?
AI assistants generate test code from descriptions, suggest locators, explain failures, refactor suites and generate test data. With the Playwright MCP server, an AI can drive a real browser to explore an app and produce tests.
37. What are the risks of AI-generated tests?
Tests that pass but assert nothing meaningful, brittle locators, invented behaviour and leaked secrets in prompts. Always review generated tests as you would a colleague’s code.
38. What is a self-healing test?
A test whose locators adapt automatically when the UI changes, using alternative attributes or AI. It reduces maintenance but should log every heal so humans can review it. See self-healing test automation.
39. You inherit a slow, flaky suite. What do you do first?
Measure: identify the slowest and flakiest tests. Quarantine the worst offenders, fix root causes, move setup to APIs, enable parallelism, and push low-value UI checks down the pyramid.
40. How would you start automation on a new project?
Agree goals and scope, pick a tool that fits the stack and team, build a minimal framework with POM, config and reporting, automate a smoke suite first, wire it into CI, then grow coverage by risk.
How to Prepare for an Automation Testing Interview
- Have a public project. A GitHub repo with a small framework, POM, API tests and a CI badge answers half the questions before they are asked. Ideas: portfolio projects that get you hired.
- Practise live coding. Expect to write a locator, a small test or a page object on screen.
- Prepare stories. A flaky test you fixed, a bug automation caught, a time you sped up a suite.
- Know the job’s stack. Read the description and brush up on its tool — see automation tools compared and the automation testing jobs guide.
- Test yourself. Try the Playwright MCQ quiz and interview practice tests.
Need the hands-on skills behind these answers? Our Playwright + Claude AI & MCP Server course builds a full framework in JavaScript — POM, fixtures, API, CI/CD and AI-assisted testing — so you can answer from experience.
Frequently Asked Questions
What are the most common software testing automation interview questions?
Common questions cover what to automate, the test pyramid, framework types and the Page Object Model, locator strategies, waits, Selenium vs Playwright, API testing, CI/CD integration, flaky tests and, increasingly, AI-assisted testing.
How do I prepare for an automation testing interview as a fresher?
Learn one framework well, build a small public GitHub project with page objects, API tests and a CI pipeline, practise writing locators and tests live, and prepare clear explanations of core concepts such as waits, POM and the test pyramid.
What coding questions are asked in automation testing interviews?
Expect to write locators, a simple test, a page object class, and basic programming tasks such as string manipulation, array handling or reading data from a file in the language used by the team.
Are automation interview questions different for Playwright and Selenium?
The fundamentals are the same: framework design, locators, waits, API and CI. Tool-specific questions differ, for example WebDriver waits in Selenium versus auto-waiting, fixtures and tracing in Playwright.
Do interviewers ask about AI in automation testing in 2026?
Increasingly, yes. Be ready to explain how you would use AI assistants or the Playwright MCP server to generate or maintain tests, and how you review AI output for correctness.
Asim Noaman
Senior QA Automation Engineer & AI Testing Specialist
With years of hands-on experience building test automation frameworks for production applications, Asim specializes in combining traditional QA methodologies with cutting-edge AI tools. He has helped teams adopt Playwright and AI-driven testing workflows to ship faster with fewer bugs.
Playwright + Claude AI Course
Answer Automation Questions From Real Experience
Build the framework interviewers ask about — taught in JavaScript, 11.5 hours across 103 lectures, rated 4.4★ from 116 ratings by 460+ students.
- Page Object Model, fixtures and test data management
- API testing and real-world end-to-end flows
- Debugging flaky tests with traces and reports
- AI-assisted testing with Claude and the Playwright MCP Server