SoftwareTestPilot
42 Q&A · Freshers → Senior SDET

Automation Testing Interview Questions and Answers (1970)

42 real automation testing interview questions and answers for freshers through senior SDETs. Fundamentals, frameworks (POM, data-driven, BDD), Selenium vs Playwright vs Cypress, CI/CD, parallel execution, API + performance automation, and scenario-based strategy — with 8 People-Also-Ask FAQs.

  • 8 min read
  • Difficulty: Mixed (Medium → Hard)
  • Freshers · SDET · 1–8+ YOE
  • Updated July 1970
  • Avinash Kamble

1. Automation Testing Fundamentals

Easy Very Common 1 min read

Q1.What is automation testing?

Automation testing uses scripts and tools to execute predefined test cases, compare actual and expected results, and report outcomes without human intervention during execution. Best fit: regression, smoke, data-driven, and load testing. Not a full replacement for exploratory or usability testing.

Easy Very Common 1 min read

Q2.What are the benefits of automation testing?

Faster feedback (minutes vs days), higher reliability, 24/7 execution, parallel runs across browsers/devices, better coverage on repetitive tests, precise performance metrics, and long-term cost savings once stable.

Easy Very Common 1 min read

Q3.Which tests should be automated and which should not?

Automate: regression, smoke, data-driven, load, cross-browser, API contract, and integration. Don't automate: one-off tests, unstable features, UX/look-and-feel, ad-hoc exploratory, tests where expected result is subjective.

Easy Very Common 1 min read

Q4.What is the automation pyramid?

Mike Cohn's test pyramid: broad base of fast unit tests (70%), middle layer of integration/API tests (20%), thin top of slow E2E UI tests (10%). Inverting it ("ice-cream cone") creates a slow, flaky suite that fails in CI.

Easy Very Common 1 min read

Q5.What is Return on Investment (ROI) for automation?

ROI = (Manual hours saved × Rate per hour × Cycles) − (Build cost + Maintenance cost). Break-even for a well-designed suite is usually 5–10 regression cycles. Calculate per-suite; don't average across the whole product.

Easy Very Common 1 min read

Q6.What is the difference between a test framework and a test tool?

A tool is software that drives execution (Selenium WebDriver, Playwright). A framework is a structured set of guidelines, utilities, patterns, and conventions built on top of tools — Page Object Model, config management, data providers, reporting, CI hooks.

Easy Very Common 1 min read

Q7.What is a test harness?

A test harness is the collection of stubs, drivers, test data, and configuration files that surround the code under test and let tests run in isolation. Common in unit testing (e.g., JUnit runner + Mockito + fixtures = harness).

Easy Very Common 1 min read

Q8.What is the difference between assertion and verification in automation?

Assertion (hard assert) stops the test on failure. Verification (soft assert) logs the failure and continues, so a single run reports every problem instead of stopping at the first. TestNG SoftAssert and Playwright expect.soft() enable this.

Confidence check

If you can confidently answer the Automation Testing Fundamentals questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

2. Frameworks & Design Patterns

Easy Very Common 1 min read

Q9.What is the Page Object Model (POM)?

POM is a design pattern where each web page/component has a class that exposes methods (login, addToCart) and hides locators. Benefits: DRY, easy maintenance when UI changes, readable tests, reusable across suites. Modern variant: Page Component Model.

Easy Very Common 1 min read

Q10.What is a data-driven framework?

A data-driven framework separates test data from test logic — data lives in Excel, CSV, JSON, or a database and the same test runs for every row. TestNG @DataProvider, JUnit @ParameterizedTest, or Playwright's test.each() handle this.

Easy Very Common 1 min read

Q11.What is a keyword-driven framework?

A keyword-driven framework encodes actions as keywords (Login, ClickButton, AssertText) in a spreadsheet or file; non-technical testers author scripts by chaining keywords. Popular via Robot Framework and legacy QTP/UFT.

Easy Very Common 1 min read

Q12.What is a hybrid framework?

A hybrid framework combines data-driven, keyword-driven, and POM patterns — most enterprise Java/TestNG suites in production. Data lives in external files, business keywords wrap POM methods, and reporting is centralized (Allure/ExtentReports).

Easy Very Common 1 min read

Q13.What is BDD (Behavior-Driven Development)?

BDD is a collaboration technique where features are described as executable scenarios in Given-When-Then (Gherkin) — readable by PO, dev, QA. Cucumber (Java/JS), SpecFlow (.NET), and Behave (Python) execute the scenarios against step definitions.

Easy Very Common 1 min read

Q14.What are the pillars of a good automation framework?

Six pillars: (1) clear folder structure, (2) config-driven environments, (3) POM or component abstraction, (4) reusable test data providers, (5) reporting + screenshots + video on failure, (6) CI/CD integration with parallel execution and retry logic.

Easy Very Common 1 min read

Q15.What design patterns are used in test automation frameworks?

Common patterns: Page Object, Singleton (WebDriver instance), Factory (browser factory), Fluent Interface (builder-style API), Strategy (test data source), and Facade (business flow wrapper on top of POM).

Easy Very Common 1 min read

Q16.How do you handle environment-specific configurations?

Externalize into environment files (config.dev.json, config.qa.json, config.prod.json) or use env vars. Load at runtime based on a system property (-Denv=qa). Never hardcode URLs, credentials, or API keys in the framework or test code.

Confidence check

If you can confidently answer the Frameworks & Design Patterns questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

3. Selenium, Playwright, Cypress & Tool Selection

Easy Common 1 min read

Q17.What is Selenium and what are its components?

Selenium is an open-source browser automation suite: WebDriver (language bindings that drive the browser via native APIs), Grid (parallel + remote execution), IDE (record/replay for prototyping). Selenium 4 added relative locators, CDP access, and Grid 4 with Docker-native scaling.

Easy Common 1 min read

Q18.What is Playwright and why is it popular?

Playwright is Microsoft's modern browser automation framework (TypeScript, JS, Python, .NET, Java) with auto-waiting, network interception, trace viewer, parallel execution, and built-in test runner. Faster and less flaky than Selenium for modern SPAs.

Easy Common 1 min read

Q19.What is Cypress and how is it different from Selenium?

Cypress is a JavaScript-only E2E framework that runs inside the browser (not via WebDriver). Faster, better DX, time-travel debugging, but limited to Chromium-family + Firefox and single-domain tests. Selenium/Playwright win on cross-language and multi-tab support.

Easy Common 1 min read

Q20.Selenium vs Playwright vs Cypress — which to choose?

Selenium: enterprise Java, Grid at scale, widest job market. Playwright: modern TypeScript/Python stacks, best flakiness profile, cross-browser + mobile web. Cypress: JS-only teams needing best DX for front-end regression. Pick based on stack, hiring pipeline, and existing infra.

Easy Common 1 min read

Q21.What are locators and which is the best?

Locators identify elements on a page. Order of preference: (1) data-testid or id (stable), (2) accessibility role + name, (3) CSS selector, (4) XPath (only when nothing else works). Avoid absolute XPath and text-based locators for i18n apps.

Easy Common 1 min read

Q22.What is the difference between implicit, explicit, and fluent waits in Selenium?

Implicit wait — global polling for element presence; set once per driver. Explicit wait (WebDriverWait + ExpectedCondition) — waits for a specific condition. Fluent wait — explicit wait with custom polling interval and ignored exceptions. Never mix implicit and explicit (unpredictable timing).

Easy Common 1 min read

Q23.How does Playwright's auto-waiting work?

Playwright automatically waits for elements to be attached, visible, stable (not animating), enabled, and receiving events before actioning. This eliminates most explicit waits and is the primary reason Playwright suites are less flaky than Selenium.

Easy Common 1 min read

Q24.What is Selenium Grid and when do you use it?

Selenium Grid distributes tests across multiple machines/browsers in parallel. Grid 4 uses a Hub + Node model, supports Docker Compose out of the box, and integrates with Kubernetes for auto-scaling. Use it when local execution can't hit the parallelism you need.

Confidence check

If you can confidently answer the Selenium, Playwright, Cypress & Tool Selection questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

4. CI/CD, Parallelization & Grid

Easy Common 1 min read

Q25.How do you integrate automation tests with CI/CD?

Trigger via GitHub Actions, Jenkins, GitLab CI, Azure DevOps, or CircleCI. Steps: checkout code → install deps → run smoke on PR → run full regression on merge → publish Allure/ExtentReports → notify Slack. Use test-tagging (@smoke, @regression) to control scope per pipeline stage.

Easy Common 1 min read

Q26.How do you achieve parallel test execution?

TestNG parallel="methods" or "tests" with thread-count. Playwright projects + workers. Cypress parallelization via Dashboard. JUnit 5 parallel execution config. Always ensure test isolation: thread-safe WebDriver (ThreadLocal), unique test data, no shared mutable state.

Easy Common 1 min read

Q27.How do you make tests thread-safe?

Store WebDriver in ThreadLocal, generate unique test data per thread (UUID + timestamp), avoid static mutable state, use per-thread config, and isolate downloads/screenshots into per-thread folders. Test with -DthreadCount=10 locally before pushing.

Easy Common 1 min read

Q28.What is Docker's role in test automation?

Docker containerizes browsers (selenium/standalone-chrome), test frameworks, and app under test — reproducible across dev laptops and CI. Docker Compose spins up Selenium Grid + app + DB with one command. Ephemeral containers per PR isolate flaky state.

Easy Common 1 min read

Q29.How do you handle test reporting?

Allure (rich HTML + trends), ExtentReports (interactive), ReportPortal (AI failure clustering), Playwright's built-in HTML reporter, and Cypress Dashboard. Attach screenshots, videos, network HAR, and logs to every failed test.

Easy Common 1 min read

Q30.How do you deal with flaky tests?

Root-cause first — is it wait, data, environment, or third-party? Fix implicit waits with explicit conditions, replace unstable selectors with data-testid, isolate test data, mock third parties, and stabilize animations. Retry flaky tests up to 2× in CI (test.retries), but always quarantine and file a bug.

Confidence check

If you can confidently answer the CI/CD, Parallelization & Grid questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

5. API, Performance & Non-UI Automation

Easy Common 1 min read

Q31.What is API test automation?

API test automation validates REST/GraphQL/SOAP endpoints without a UI — faster and more stable than UI tests. Tools: RestAssured (Java), Requests + Pytest (Python), Postman + Newman, Playwright APIRequestContext, Karate DSL, k6 for load.

Easy Occasional 1 min read

Q32.How do you validate an API response?

Check: HTTP status code, response time, response headers, response body (schema, values, JSONPath assertions), error handling for 4xx/5xx, authentication/authorization, and idempotency for POST/PUT/DELETE. Use JSON schema validators or Pact for contract testing.

Easy Occasional 1 min read

Q33.What is contract testing?

Contract testing (Pact, Spring Cloud Contract) validates that a consumer and provider agree on request/response shape — the provider runs consumer-generated contract tests in its pipeline. Prevents integration bugs across microservices without slow E2E environments.

Easy Occasional 1 min read

Q34.What is performance test automation and which tools do you use?

Performance testing measures response time, throughput, and stability under load. Tools: JMeter (open-source, plugin-rich), k6 (JS-scriptable, developer-friendly), Gatling (Scala DSL, high performance), Locust (Python), Azure Load Testing.

Easy Occasional 1 min read

Q35.What is service virtualization?

Service virtualization simulates third-party or downstream services (payment gateway, mainframe, partner API) so tests can run without them. Tools: WireMock, MockServer, Hoverfly, Mountebank. Critical when dependencies are unstable, rate-limited, or costly.

Easy Occasional 1 min read

Q36.What is visual regression testing?

Visual regression testing captures screenshots and diffs them against baselines to catch UI/UX regressions (moved buttons, broken CSS). Tools: Percy, Applitools Eyes, Chromatic, Playwright's toHaveScreenshot(). AI-driven tools ignore anti-aliasing and dynamic content noise.

Confidence check

If you can confidently answer the API, Performance & Non-UI Automation questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

6. Strategy, Metrics & Scenario-Based

Easy Occasional 1 min read

Q37.What metrics do you track for automation?

Automation coverage %, pass rate, mean time to detect (MTTD), mean time to repair (MTTR), flaky-test rate, average execution time, defect leakage %, tests per feature, and framework maintenance hours. Track trends, not absolute numbers.

Easy Occasional 1 min read

Q38.How do you decide the automation vs manual ratio?

Risk + stability + frequency. Automate 80–90% of stable regression, 100% of API contract, 100% of load. Keep 20% manual bandwidth for exploratory, UX, one-off, and new-feature investigation. Revisit ratio every quarter.

Easy Occasional 1 min read

Q39.How do you scale automation across multiple teams?

Centralize the framework (shared BOM/library), publish coding standards + PR template, run brown-bag sessions, and appoint SDET champions per squad. Governance model: shared framework, team-owned tests, common CI templates, weekly test-health review.

Easy Occasional 1 min read

Q40.How do you handle dynamic elements (auto-generated IDs, changing text)?

Request stable data-testid from developers (best). Otherwise use relative locators (Selenium 4), text + role selectors (Playwright), or parent-child CSS. Avoid absolute XPath and IDs that contain UUIDs or timestamps.

Easy Occasional 1 min read

Q41.A test suite that ran green suddenly turns 60% red. How do you triage?

Check the last commit and CI environment change. Group failures by error signature (locator not found, timeout, assertion). If concentrated in one module → likely UI change, sync with dev. If scattered → likely environment/network/test data. Run 5 samples locally in headed mode with trace enabled to pinpoint.

Easy Occasional 1 min read

Q42.How do you convince management to invest in automation?

Show cost of manual regression per release × release frequency, current defect leakage, and time-to-market delay. Present a phased plan: pilot on one critical flow → measure ROI → expand. Track and publish MTTR/coverage/leakage monthly to keep momentum.

Confidence check

If you can confidently answer the Strategy, Metrics & Scenario-Based questions above, you're well prepared for this section of your interview. Move on, or rehearse the trickier ones aloud with our AI mock interviewer.

Quick revision

  1. Q1: What is automation testing — Automation testing uses scripts and tools to execute predefined test cases, compare actual and expected results, and report outcomes without human intervention during execution.
  2. Q2: What are the benefits of automation testing — Faster feedback (minutes vs days), higher reliability, 24/7 execution, parallel runs across browsers/devices, better coverage on repetitive tests, precise performance metrics, and
  3. Q3: Which tests should be automated and which should not — Automate : regression, smoke, data-driven, load, cross-browser, API contract, and integration.
  4. Q4: What is the automation pyramid — Mike Cohn's test pyramid : broad base of fast unit tests (70%), middle layer of integration/API tests (20%), thin top of slow E2E UI tests (10%).
  5. Q5: What is Return on Investment (ROI) for automation — ROI = (Manual hours saved × Rate per hour × Cycles) − (Build cost + Maintenance cost).

Frequently asked questions

The 2026 shortlist: what to automate vs not, ROI of automation, Page Object Model, data-driven testing, hybrid vs BDD frameworks, Selenium vs Playwright vs Cypress, waits, parallel execution, CI/CD integration, and flaky test debugging — all covered on this page with 40+ answers.

For Java + enterprise roles → Selenium. For TypeScript + startups → Playwright. For JavaScript full-stack teams → Cypress. Most senior SDETs know two: Selenium for job breadth, Playwright/Cypress for developer experience.

Fresher automation ₹5–8 LPA, 2–4 YOE ₹9–16 LPA, 5+ YOE ₹18–30 LPA, SDET Lead 8+ YOE ₹30–55 LPA. Playwright + TypeScript pays 15–25% more than Selenium + Java at product companies in 2026.

ROI = (Manual effort saved × Rate) − (Automation build + Maintenance cost). Break-even usually hits after 5–10 regression cycles for a well-designed suite. Use our Automation ROI calculator to estimate for your team.

A flaky test passes and fails intermittently on the same code. Root causes: implicit waits, unstable selectors, shared test data, external dependencies, animations. Fix by using explicit waits, stable data-testid selectors, isolated test data, mocking third parties, and quarantining flaky tests until fixed.

Yes. Automation testing requires solid programming in at least one language (Java, Python, JavaScript/TypeScript, C#). Fresher automation roles ask basic coding (loops, collections, OOP); senior SDET roles ask data structures, design patterns, and framework architecture.

TDD (Test-Driven Development) — developer writes a unit test first, then code to pass it. BDD (Behavior-Driven Development) — collaboration technique where features are described as Given-When-Then scenarios (Cucumber, SpecFlow) understandable by non-technical stakeholders.

High initial build and maintenance cost; not useful for exploratory or UX testing; brittle if selectors or environments change; requires programming skills; false confidence if coverage is only skin-deep; and can hide UX bugs that only humans notice.

Was this article helpful?

Cluster · QA Career

More from QA Interview Questions

Behavioral, framework, coding — full interview prep.

Pillar guide · 10 articles
More in this cluster
From the QA Career pillar

Key takeaways

  • Master the fundamentals before tackling advanced SDET scenarios.
  • Always explain trade-offs — interviewers reward judgement, not memorisation.
  • Use real project examples; generic answers blend in.
  • Practice answers out loud — written prep doesn't transfer to live rounds.
  • Revise the 30-second cheat sheet the night before your interview.
  • Keep one strong scenario story ready for every section above.

These Questions Are Just the Start

Get 1000+ more with detailed model answers in our QA Interview Preparation Kit. Covers manual testing, automation, API, SQL, Selenium, Playwright, and framework concepts — everything asked in real QA interviews.

Get Interview Kit — ₹1,045

SDET jobs hiring now

Live, indexable SDET openings — updated daily in Jobs Radar.

Browse all QA jobs on Jobs Radar

Loading current openings…

Home