These automation testing interview questions cover everything around the tool: testing fundamentals, programming, framework design, API automation, CI/CD, BDD, Grid and cloud execution, and the strategy questions senior candidates face. For Selenium-specific questions by experience level, see the Selenium interview questions for freshers, 1 year, 3 years and 5 years.
Software Testing Fundamentals
What is Software Testing? Why is it important?
✔ Software Testing is the process of evaluating a software application to identify defects and verify that it meets specified requirements before delivery to users.
- Detects bugs early — fixing a bug in testing is 10x cheaper than in production
- Validates functionality against business requirements
- Improves reliability, performance, and security of the application
- Builds stakeholder confidence and ensures user satisfaction
- Prevents financial loss and reputational damage caused by production failures
What is the difference between Manual Testing and Automation Testing?
| Aspect | Manual Testing | Automation Testing |
|---|---|---|
| Execution | Done by humans, step by step | Done by automated scripts/tools |
| Speed | Slow — limited by human pace | Fast — runs in parallel |
| Cost | Low initial, high long-term for regression | High initial, low long-term |
| Accuracy | Prone to human error | Consistent and accurate |
| Best For | Exploratory, UX, ad-hoc testing | Regression, smoke, data-driven tests |
| Maintenance | No script maintenance | Scripts need maintenance on UI changes |
What is SDLC? Name and explain its phases.
✔ SDLC (Software Development Life Cycle) is a structured process for planning, creating, testing, and deploying software.
- 1. Requirement Gathering & Analysis — Understand what to build
- 2. System Design — Architect the solution (HLD & LLD)
- 3. Implementation (Coding) — Developers write the code
- 4. Testing & QA — Testers verify quality and find defects
- 5. Deployment — Release to production environment
- 6. Maintenance — Bug fixes and enhancements post-release
💡 Tip: As a tester, you are primarily involved in phases 1, 4, and 5.
What is STLC (Software Testing Life Cycle)? Explain each phase.
✔ STLC is the sequence of specific testing activities performed to ensure quality throughout the development lifecycle.
- 1. Requirement Analysis — Identify testable requirements; create RTM (Requirement Traceability Matrix)
- 2. Test Planning — Define scope, estimate effort, identify risks, create test plan
- 3. Test Case Design — Write test cases, test scripts, and test data preparation
- 4. Test Environment Setup — Configure hardware, software, and test data
- 5. Test Execution — Execute test cases, log defects, update test results
- 6. Test Closure — Generate test summary report, lessons learned, archive artifacts
What is the difference between Smoke Testing and Sanity Testing?
| Smoke Testing | Sanity Testing |
|---|---|
| Done on a new build to check stability | Done after bug fixes to verify the fix |
| Broad, shallow — covers all major features | Narrow, deep — focuses on specific area |
| Performed by testers or build team | Performed by testers |
| Also called Build Verification Test (BVT) | Subset of regression testing |
| Fails fast if major features are broken | Confirms specific functionality works |
Explain the Defect Life Cycle with all its stages.
✔ The Defect Life Cycle tracks a bug from discovery to resolution.
- New → Bug is logged for the first time by tester
- Assigned → Bug is assigned to developer for investigation
- Open → Developer starts analyzing the bug
- Fixed → Developer has applied the fix
- Retest → Tester re-executes the failed test case
- Verified → Tester confirms bug is fixed successfully
- Closed → Bug is resolved and closed
- Reopened → Bug resurfaces after being closed
- Rejected → Bug is invalid, not reproducible, or working as designed
- Deferred → Fix postponed to a future release
What are the different types of testing? Categorize them.
✔ Testing types are broadly classified into four categories:
- Functional Testing: Unit, Integration, System, Regression, Acceptance (UAT), Smoke, Sanity
- Non-Functional Testing: Performance, Load, Stress, Endurance, Security, Usability, Accessibility
- Structural Testing (White-Box): Code coverage, Branch coverage, Path testing
- Change-Related Testing: Regression Testing, Retesting (after a specific fix)
What is the difference between Verification and Validation?
| Verification | Validation |
|---|---|
| Are we building the product right? | Are we building the right product? |
| Process-oriented — reviews, walkthroughs, inspections | Product-oriented — actual execution/testing |
| Done without executing the application | Done by executing the application |
| Static testing technique | Dynamic testing technique |
| Examples: Code review, design review, test case review | Examples: Functional testing, UAT, system testing |
Java / Python Programming Basics for Testers
What are the four pillars of OOPs? Explain with examples relevant to test automation.
✔ OOPs (Object-Oriented Programming) is the foundation of Java-based Selenium automation.
- Encapsulation: Hiding internal data — e.g., WebDriver instance kept private in a BasePage class, exposed only via getter methods
- Inheritance: Child class inherits parent — e.g., LoginPage extends BasePage to reuse driver initialization and common methods
- Polymorphism: Same method, different behavior — e.g., overriding a clickElement() method differently for desktop vs mobile tests
- Abstraction: Hiding complexity — e.g., calling loginPage.login(username, password) without knowing WebDriver internals
What is the difference between Array and ArrayList in Java?
| Array | ArrayList |
|---|---|
| Fixed size — cannot grow/shrink | Dynamic size — grows automatically |
| Can store primitives (int, char, etc.) | Stores only objects (Integer, String, etc.) |
| Faster for indexed access | Slightly slower due to boxing/unboxing |
| int[] arr = new int[5]; | ArrayList<String> list = new ArrayList<>(); |
| No built-in methods (add, remove) | Rich API: add(), remove(), contains(), size() |
What is Exception Handling? Why is it important in automation scripts?
✔ Exception handling prevents scripts from crashing unexpectedly and allows graceful recovery.
- try block — contains code that might throw an exception (e.g., driver.findElement())
- catch block — handles the specific exception (e.g., NoSuchElementException)
- finally block — always runs, used for cleanup (e.g., driver.quit())
- throw — manually raise an exception; throws — declare checked exceptions in method signature
- Common exceptions in Selenium: NoSuchElementException, StaleElementReferenceException, TimeoutException, ElementNotInteractableException
try {
driver.findElement(By.id("username")).click();
} catch (NoSuchElementException e) {
logger.error("Element not found: " + e.getMessage());
} finally {
driver.quit();
}
What is the difference between == and .equals() in Java?
✔ This is a very common Java interview question for testers.
- == operator: Compares object references (memory addresses), not the actual content
- .equals() method: Compares the actual content/value of objects
- Example:
String s1 = new String("hello"); String s2 = new String("hello"); s1 == s2 → FALSE (different objects in heap memory)s1.equals(s2) → TRUE (same character content)- Exception: String literals ("hello") are stored in String pool — s1 == s2 is TRUE for literals
What are Collections in Java? Which ones do you use in automation?
✔ Collections are frameworks that provide data structures for storing groups of objects.
- List (ArrayList / LinkedList): Ordered, allows duplicates — used to store WebElements, test data rows
- Set (HashSet / LinkedHashSet): No duplicates, unordered — used to store unique test IDs
- Map (HashMap / LinkedHashMap): Key-value pairs — used for config data, locator maps, environment variables
- Queue (LinkedList): FIFO — used in some workflow automation sequences
- Most used in automation: List<WebElement>, Map<String, String>, ArrayList<String>
What is the difference between String, StringBuilder, and StringBuffer?
| String | StringBuilder | StringBuffer |
|---|---|---|
| Immutable — new object on modification | Mutable — in-place modification | Mutable — in-place modification |
| Thread-safe (immutable) | NOT thread-safe | Thread-safe (synchronized) |
| Slow for repeated concatenation | Fast — best for single-thread | Moderate — best for multi-thread |
| Used for constant strings | Used in loops, dynamic XPaths | Used in multi-threaded test setups |
Advanced Framework Design
What is a Hybrid Framework? What are its advantages?
✔ A Hybrid Framework combines Data-Driven and Keyword-Driven frameworks into a single architecture.
- Data-Driven component: Test data stored externally (Excel, JSON, DB) and fed to tests at runtime
- Keyword-Driven component: Action keywords (click, enterText, verifyText) stored in Excel — usable by non-coders
- Advantages: High reusability, non-technical testers can create tests, easy to scale and maintain
- Components: Action keywords, Object Repository (locators), Test Data, Driver Script, Utility libraries
- Example: Excel row says 'clickButton | loginButton' — driver script reads keyword and calls the corresponding method
How do you read data from Excel using Apache POI?
✔ Apache POI is the standard Java library for reading/writing Microsoft Office files.
- Add dependency: org.apache.poi:poi-ooxml in pom.xml
FileInputStream fis = new FileInputStream("src/test/resources/testdata.xlsx");XSSFWorkbook workbook = new XSSFWorkbook(fis);XSSFSheet sheet = workbook.getSheet("LoginData");Row row = sheet.getRow(1); // 0-indexed; Row 0 is usually headerString username = row.getCell(0).getStringCellValue();int count = (int) row.getCell(1).getNumericCellValue();- Always call workbook.close() and fis.close() to prevent memory leaks
How do you set up ExtentReports in a Selenium TestNG framework?
✔ ExtentReports is a widely-used HTML reporting library for Selenium tests.
- Add dependency: com.aventstack:extentreports in pom.xml
In @BeforeSuite: ExtentReports extent = new ExtentReports();ExtentSparkReporter spark = new ExtentSparkReporter("reports/extent-report.html");extent.attachReporter(spark);In @Test or Listener: ExtentTest test = extent.createTest("Login Test");test.pass("Entered credentials"); test.fail("Login button not found");In @AfterSuite: extent.flush(); // Writes report to disk- For screenshots:
test.addScreenCaptureFromPath("screenshots/failure.png"); - For logs:
test.log(Status.INFO, "Navigating to login page");
How do you implement logging with Log4j2 in your framework?
✔ Log4j2 provides structured logging at different severity levels for debugging test execution.
- Add dependency: org.apache.logging.log4j:log4j-core in pom.xml
- Create log4j2.xml in src/main/resources/ — defines appenders (Console, File) and log levels
- In each class:
private static final Logger logger = LogManager.getLogger(LoginPage.class); logger.info("Clicking login button");logger.debug("Username value: " + username);logger.warn("Retry attempt #" + count);logger.error("Element not found", exception);- Log Levels (lowest to highest): TRACE < DEBUG < INFO < WARN < ERROR < FATAL
How do you manage test configurations across environments (Dev/QA/Prod)?
✔ Environment-specific configuration is a key framework design concern.
- Store configs in config.properties: base.url=https://qa.example.com, browser=chrome
- Create ConfigReader.java: loads properties file using Properties class
- Pass environment via Maven: mvn test -Denv=qa → read System.getProperty("env")
- Load environment-specific properties file: config-qa.properties, config-prod.properties
- Store sensitive data (passwords, API keys) in environment variables, NOT in code or properties files
- Use separate testng.xml per environment for different test suites
API Testing with REST Assured
What is REST API? Explain HTTP methods and when to use them.
✔ REST (Representational State Transfer) is an architectural style for web services using HTTP.
- GET — Retrieve data from server; idempotent; no request body
- POST — Create a new resource; not idempotent; has request body
- PUT — Update an existing resource completely (replace entire object)
- PATCH — Partially update a resource (update specific fields only)
- DELETE — Remove a resource from server
- HEAD — Like GET but returns headers only (check if resource exists)
- OPTIONS — Returns allowed HTTP methods for a URL (used in CORS preflight)
What are the most common HTTP status codes a tester must know?
| Code | Status | Meaning / When It Occurs |
|---|---|---|
| 200 | OK | Successful GET, PUT, PATCH request |
| 201 | Created | Successful POST — new resource created |
| 204 | No Content | Successful DELETE — no response body |
| 400 | Bad Request | Invalid input, missing required fields |
| 401 | Unauthorized | Missing or invalid authentication credentials |
| 403 | Forbidden | Authenticated but no permission to access |
| 404 | Not Found | Resource does not exist at that URL |
| 409 | Conflict | Duplicate data — e.g., user already exists |
| 422 | Unprocessable Entity | Valid syntax but semantic error |
| 500 | Internal Server Error | Server-side bug or exception |
| 503 | Service Unavailable | Server is down or overloaded |
Write a complete GET and POST request test using REST Assured.
✔ REST Assured provides a fluent BDD-style DSL for API testing.
- // GET Request
given().baseUri("https://reqres.in/api").header("Accept", "application/json").when().get("/users/2").then().statusCode(200).body("data.first_name", equalTo("Janet")).body("data.id", equalTo(2));- // POST Request
given().contentType(ContentType.JSON).body("{\"name\": \"John\", \"job\": \"developer\"}").when().post("/users").then().statusCode(201).body("name", equalTo("John"));
How do you handle different types of authentication in API testing?
| Auth Type | REST Assured Implementation | When Used |
|---|---|---|
| Basic Auth | .auth().basic("user", "pass") | Simple username/password |
| Bearer Token | .header("Authorization", "Bearer " + token) | OAuth 2.0 APIs |
| API Key (Header) | .header("x-api-key", "YOUR_KEY") | Service-to-service APIs |
| API Key (Query) | .queryParam("api_key", "YOUR_KEY") | Public REST APIs |
| OAuth 2.0 | .auth().oauth2("accessToken") | Google, GitHub OAuth flows |
What is JSON Path? How do you extract values from a REST API response?
✔ JSON Path is used to extract and validate specific values from JSON response bodies.
- Extract single value:
String name = response.jsonPath().getString("data.first_name"); - Extract nested value:
String city = response.jsonPath().getString("address.city"); - Extract from array:
String first = response.jsonPath().getString("users[0].name"); - Extract list:
List<String> names = response.jsonPath().getList("users.name"); - Get count: int count = response.jsonPath().getInt("users.size()");
- Validate with Hamcrest: .body("users.name", hasItems("Alice", "Bob"))
What is Serialization and Deserialization? How are they used in API automation?
✔ Serialization: Java Object → JSON string. Deserialization: JSON string → Java Object.
- Add Jackson dependency: com.fasterxml.jackson.core:jackson-databind
- Create POJO: public class User { public String name; public String email; }
- Serialize (Object to JSON):
ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(userObj); - Deserialize (JSON to Object):
User user = mapper.readValue(jsonString, User.class); - In REST Assured: .body(userObj) auto-serializes when Jackson is in classpath
- Extract as object:
User user = response.as(User.class); — auto-deserializes response body
CI/CD with Jenkins & Git
What is CI/CD? Why is it critical for test automation?
✔ CI/CD (Continuous Integration / Continuous Delivery) automates build, test, and deployment pipelines.
- CI: Every code commit triggers automated build and test execution
- CD: Tested code is automatically delivered to staging or production
- Benefits for automation: Tests run on every commit, failures caught immediately, no manual test triggering
- Automation value multiplies in CI/CD — tests that run daily catch regressions instantly
- Tools: Jenkins, GitHub Actions, GitLab CI, Azure DevOps, CircleCI, TeamCity
How do you integrate a Selenium automation project with Jenkins?
✔ Step-by-step Jenkins integration for Maven + TestNG + Selenium:
- 1. Install Jenkins; add plugins: Maven Integration, Git, HTML Publisher, Email Extension
- 2. Create new Freestyle Job or Pipeline in Jenkins dashboard
- 3. Source Code Management: Select Git, provide repo URL and credentials
- 4. Build Triggers:
Poll SCM (* * * * *) or configure GitHub Webhook - 5. Build Step: 'Invoke top-level Maven targets' → Goals: clean test
- 6. Post-Build: 'Publish HTML Reports' pointing to reports/ folder for Extent Reports
- 7. Post-Build: 'Email Notification' — send email on failure to team
- 8. Schedule: Build periodically using cron (H 22 * * 1-5) for nightly runs
What are key Git commands every automation tester must know?
✔ Git is essential for version-controlling automation scripts in team environments.
- git clone <url> — Download repository to local machine
- git status — See what files have been modified/staged
- git add . — Stage all changes for commit
- git commit -m 'Add login automation tests' — Commit with meaningful message
- git push origin feature/login-tests — Push branch to remote
- git pull origin develop — Pull latest changes from remote
- git checkout -b feature/checkout-tests — Create and switch to new branch
- git merge develop — Merge another branch into current
- git log --oneline — View condensed commit history
- git stash / git stash pop — Temporarily save/restore uncommitted work
How do you write test automation SQL queries for database validation?
✔ Database validation ensures backend data matches what the UI displays.
- Setup: Add MySQL/PostgreSQL JDBC driver dependency to pom.xml
- Connection:
Connection conn = DriverManager.getConnection(url, user, pass); - Query:
ResultSet rs = stmt.executeQuery("SELECT status FROM orders WHERE id=" + orderId); - Validate:
assertEquals(rs.getString("status"), "CONFIRMED"); - Key SQL: SELECT, WHERE, JOIN, COUNT(*), GROUP BY, ORDER BY, INSERT, UPDATE, DELETE
- Test cleanup:
DELETE FROM test_orders WHERE created_by="automation_suite"; - Always close ResultSet, Statement, Connection in finally block or use try-with-resources
BDD with Cucumber
What is BDD? How does Cucumber implement it?
✔ BDD (Behavior Driven Development) bridges the gap between business and technical teams using plain-English test scenarios.
- Feature Files: Written in Gherkin language (Given/When/Then) — readable by business stakeholders
- Step Definitions: Java methods annotated with @Given, @When, @Then that implement the Gherkin steps
- Hooks: @Before and @After annotations for setup/teardown at scenario level
- CucumberOptions runner: JUnit/TestNG class that links feature files to step definitions
- Reports: HTML, JSON, Allure, Extent — configured in CucumberOptions
- Key benefit: Tests serve as living documentation that everyone on the team can understand
Write a complete example of a Cucumber feature file with Scenario Outline.
✔ Gherkin syntax example for a login feature:
- Feature: User Authentication
- Background:
- Given the user is on the Login page
- Scenario: Successful login with valid credentials
- When the user enters username 'admin' and password 'pass123'
- And the user clicks the Login button
- Then the user should be redirected to the Dashboard
- Scenario Outline: Login with multiple users
- When the user enters username '<username>' and password '<password>'
- And the user clicks the Login button
- Then the page should show '<result>'
- Examples:
- | username | password | result |
- | admin | pass123 | Dashboard |
- | user1 | wrong | Invalid login |
What is the difference between Scenario and Scenario Outline in Cucumber?
| Scenario | Scenario Outline |
|---|---|
| Single test case with hardcoded data | Data-driven — runs once per row in Examples table |
| No Examples table required | Requires an Examples table with test data |
| Use for unique, specific business scenarios | Use for same flow tested with multiple data sets |
| Runs exactly once | Runs N times (N = number of data rows) |
| Faster to write for one-off scenarios | Eliminates duplicate scenarios with different data |
What are Cucumber Hooks? How are they different from TestNG annotations?
✔ Cucumber Hooks intercept scenario execution for setup and teardown.
- @Before — Runs before each scenario: ideal for driver initialization, logging test start
- @After — Runs after each scenario: screenshot on failure, driver quit, test cleanup
- @BeforeStep / @AfterStep — Runs before/after each individual step (Cucumber 5+)
- Tagged Hooks: @Before("@web") — Only runs before scenarios tagged with @web
- Order control: @Before(order=1) runs before @Before(order=2)
- Difference from TestNG: Hooks belong to step definition context, support tags, more Cucumber-native
- TestNG annotations (@BeforeMethod) don't understand Cucumber tags; Hooks do
How do you share state between steps in Cucumber? What is PicoContainer?
✔ Sharing state (like WebDriver) between different step definition classes requires dependency injection.
- Instance Variables: Works only if all steps are in same class — not scalable
- PicoContainer (Recommended): A lightweight DI framework supported natively by Cucumber-JVM
- Add dependency: io.cucumber:cucumber-picocontainer
- Create a shared context class: public class TestContext { public WebDriver driver; }
- Inject via constructor: public LoginSteps(TestContext context) { this.context = context; }
- PicoContainer creates one TestContext per scenario, shared across all step definition classes
- Ensures thread-safe state sharing in parallel execution scenarios
Selenium Grid, Docker & Cloud Testing
What is Selenium Grid? How does it work in Selenium 4?
✔ Selenium Grid enables parallel test execution across multiple browsers, OS, and machines.
- Selenium 3 Grid: Hub (central server) + Nodes (browser machines) — two separate processes
- Selenium 4 Grid: Simplified — Single node or distributed Hub/Router/Distributor/Node setup
- Use case: Run tests on Chrome+Firefox+Safari simultaneously to reduce total execution time
- Use case: Cross-platform testing (Windows/Mac/Linux) without owning each machine
- Start Grid: java -jar selenium-server.jar standalone
- Point tests to Grid: driver = new RemoteWebDriver(new URL("http://localhost:4444"), options);
How do you set up Selenium Grid using Docker Compose?
✔ Docker provides isolated, reproducible environments for Selenium Grid.
- Pull images: docker pull selenium/hub, docker pull selenium/node-chrome
- docker-compose.yml: define selenium-hub service and chrome/firefox node services
- Nodes connect to hub via SE_EVENT_BUS_HOST environment variable
- docker-compose up -d — Start entire Grid in background
- Access Grid console: http://localhost:4444/ui
- Scale nodes: docker-compose up -d --scale chrome=5
- Benefits: Consistent environment, no browser installation, easy CI integration, auto-cleanup
How do you run tests on BrowserStack or Sauce Labs?
✔ Cloud platforms provide real browsers and devices on their infrastructure.
- Get credentials: BrowserStack username and access key from account dashboard
- Hub URL: https://USERNAME:ACCESSKEY@hub-cloud.browserstack.com/wd/hub
- Set capabilities: os, os_version, browser, browser_version, project, build, name
ChromeOptions options = new ChromeOptions();options.setCapability("bstack:options", bstackOptions); // BrowserStack specific caps- driver = new RemoteWebDriver(new URL(hubURL), options);
- Results, videos, screenshots, and logs visible in BrowserStack Automate dashboard
- Useful for testing on real mobile devices too — iOS Safari, Android Chrome
Test Strategy, Best Practices & Senior-Level Thinking
What is the Test Pyramid? How do you apply it to define an automation strategy?
✔ The Test Pyramid (Mike Cohn) defines the ideal ratio of test types for maximum ROI.
- Unit Tests (70% base): Fastest, cheapest — written by developers to test individual methods
- Integration/API Tests (20% middle): Test contracts between services — REST Assured, JDBC
- UI/E2E Tests (10% top): Slowest, most expensive — test critical user journeys only
- Anti-pattern to avoid: 'Ice Cream Cone' — many UI tests, few unit/API tests
- Application: Automate regression at API level (faster, more stable), smoke tests at UI level
- For microservices: Add a 'Service/Component' layer between unit and UI in the pyramid
What is Shift-Left Testing? How does it impact automation strategy?
✔ Shift-Left means testing earlier in the SDLC to catch defects when they cost least to fix.
- Cost of fixing bugs: Requirements phase = $1 | Design = $10 | Coding = $100 | Testing = $1000 | Production = $10,000
- Testers involved in requirement reviews and 3-amigo sessions from day 1
- TDD/BDD: Tests written before/alongside code — not after
- Unit and integration tests committed with every code change
- CI/CD pipeline runs tests on every PR — fail fast principle
- Impact: Automation scripts need to be ready before UAT, covering API layer primarily
How do you identify, diagnose, and fix flaky tests?
✔ Flaky tests are the biggest enemy of CI/CD confidence. Systematic approach to fix them:
- Identify: Tag tests that fail intermittently in CI; track failure rate per test over 30 days
- Timing issues: Replace all Thread.sleep() with explicit waits; ensure elements are interactable
- Data issues: Use independent test data; clean up created data in @AfterMethod
- Environment issues: Isolate tests; ensure test environment is stable and consistent
- Locator issues: Use stable IDs/accessibility IDs instead of dynamic XPaths
- Test isolation: Each test must set up its own preconditions — no dependency on test order
- Retry mechanism: Use IRetryAnalyzer in TestNG for genuine infrastructure blips
- Quarantine: Move flaky tests to separate suite; don't let them block CI pipeline
How do you decide what to automate vs. keep manual?
✔ ROI and stability are the primary criteria for automation candidates.
- Automate: Regression tests run on every release (smoke, critical path), data-driven scenarios
- Automate: Tests with deterministic expected results, stable features with few UI changes
- Automate: High-risk, high-frequency flows (login, checkout, payment)
- Don't Automate: Tests run only once, exploratory testing, UI aesthetics/look-and-feel
- Don't Automate: Frequently changing requirements, tests requiring complex human judgment
- ROI Formula: If (manual time per run × number of planned runs) > automation development + maintenance time → automate
- 3× Rule: If a test will run 3+ times in the near future, consider automating it
How would you design an automation framework from scratch? Walk through your approach.
✔ Framework design is the most important senior-level question. Structured approach:
- 1. Requirement Analysis: Understand app type (web/mobile/API), tech stack, team size, CI/CD tools in use
- 2. Tool Selection: Web → Selenium 4 + Java 11 + TestNG + Maven; API → REST Assured; Reporting → ExtentReports + Log4j2
- 3. Project Skeleton: Maven project, define package structure (base, pages, tests, utils, config)
- 4. Base Layer: BaseTest.java (WebDriverFactory, setup/teardown), BasePage.java (common actions, waits)
- 5. Page Layer: POM with Page Factory — one class per page, named actions, no raw driver calls in tests
- 6. Test Layer: TestNG classes, each test ≤ 10 lines, no Selenium code — only page method calls
- 7. Utilities: ExcelUtils, JSONUtils, DateUtils, ScreenshotUtils, APIHelper, ConfigReader, DBUtils
- 8. Data Management: External data in Excel/JSON, environments in config.properties, secrets in env vars
- 9. Reporting: ExtentReports (HTML), Log4j2 (console + file), Allure (optional for CI dashboard)
- 10. CI/CD: Jenkins pipeline with GitHub triggers, parallel execution via TestNG XML, email on failure
- 11. Maintenance Plan: Code reviews for all test PRs, monthly cleanup of obsolete tests, locator health checks
What design patterns have you applied in your automation framework?
✔ Senior testers are expected to know and apply software design patterns.
- Page Object Model — Encapsulates page UI and actions, improves maintainability
- Singleton — Single WebDriver instance per thread; single ConfigReader instance
- Factory Method — WebDriverFactory creates browser-specific drivers based on config (Chrome, Firefox, Edge)
- Builder — Constructs complex test data POJOs with optional fields using builder pattern
- Strategy — Selects data reading strategy at runtime (ExcelStrategy, JSONStrategy, DBStrategy)
- Facade — APIHelper class provides simple methods wrapping complex REST Assured setup
- Observer/Listener — TestNG/Cucumber Listeners for cross-cutting concerns (logging, screenshots, reports)
- ThreadLocal — Ensures thread-safe WebDriver in parallel test execution scenarios
FAQs
What should I prepare for an automation testing interview?
Testing fundamentals, one programming language (usually Java), your automation tool, a framework you can explain, API testing, CI/CD basics and a few real problems you solved, with numbers.
Which automation testing tools are most asked about?
Selenium with Java and TestNG, REST Assured or Postman for APIs, Cucumber for BDD, Jenkins and Git for CI, and increasingly Playwright.
How are senior automation interviews different?
They focus less on commands and more on design: framework architecture, test strategy, CI/CD, flakiness, metrics and leading other testers.