Showing posts with label Web Driver. Show all posts
Showing posts with label Web Driver. Show all posts

Thursday, July 16

Selenium Web Driver Interview Q&A


1. Selenium Web Driver Interview Q&A

Q1. What is Selenium WebDriver?

Answer:
Selenium WebDriver is an open-source automation tool used to automate web applications. It directly communicates with the browser through browser-specific drivers like ChromeDriver and GeckoDriver.

Q2. What are the components of Selenium?

Answer:

  • Selenium IDE
  • Selenium WebDriver
  • Selenium Grid

Q3. Why WebDriver instead of Selenium RC?

Answer:

  • Faster execution
  • Direct browser communication
  • No Selenium Server required
  • Better browser support

Q4. What is ChromeDriver?

Answer:
ChromeDriver is a browser-specific driver that enables Selenium to control the Chrome browser.

Q5. Difference between driver.close() and driver.quit()

close()quit()
Closes current browser windowCloses all browser windows
Session remainsSession ends completely

Q6. What are different locators?

  • ID
  • Name
  • ClassName
  • TagName
  • LinkText
  • PartialLinkText
  • CSS Selector
  • XPath

Q7. Difference between Absolute XPath and Relative XPath?

Absolute XPath

/html/body/div/input

Relative XPath

//input[@id='username']

Relative XPath is preferred because it is more reliable and maintainable.

Q8. What are Explicit Wait and Implicit Wait?

Implicit Wait

  • Global wait
  • Applies to all elements

Explicit Wait

  • Waits for a specific condition
  • More efficient

Q9. What is Page Object Model (POM)?

Answer:
POM is a design pattern where each web page has its own class containing locators and methods. It improves code readability, maintainability, and reusability.

Q10. What are the advantages of Selenium?

  • Free and open source
  • Multiple browser support
  • Multiple programming languages
  • Large community
  • CI/CD integration

2. Playwright Interview Q&A

Q1. What is Playwright?

Answer:
Playwright is a modern automation framework developed by Microsoft for testing web applications across Chromium, Firefox, and WebKit browsers.

Q2. Why Playwright is better than Selenium?

Answer:

  • Auto waiting
  • Faster execution
  • Built-in parallel execution
  • Network interception
  • Browser contexts
  • Trace Viewer
  • Video recording

Q3. What is Browser Context?

Answer:
A Browser Context is an isolated browser session, similar to an incognito window. It allows multiple independent sessions without opening multiple browsers.

Q4. What is Auto Wait?

Answer:
Playwright automatically waits for elements to be visible, stable, enabled, and ready before interacting with them.

Q5. Which browsers are supported?

  • Chromium
  • Firefox
  • WebKit

Q6. Can Playwright test APIs?

Answer:
Yes. Playwright includes built-in API testing support, allowing HTTP requests to be executed without a browser.

Q7. What is Trace Viewer?

Answer:
Trace Viewer records test execution, screenshots, network activity, and console logs to help debug failures.

Q8. Does Playwright support parallel execution?

Answer:
Yes. Playwright Test has built-in support for parallel execution without additional libraries.

3. Cypress Interview Q&A

Q1. What is Cypress?

Answer:
Cypress is a JavaScript-based end-to-end testing framework that runs directly inside the browser.

Q2. Why is Cypress fast?

Answer:
It runs in the same browser execution loop as the application instead of communicating through WebDriver, reducing overhead.

Q3. What is Time Travel?

Answer:
Time Travel lets you inspect the application state at each command during test execution, making debugging easier.

Q4. Does Cypress support multiple tabs?

Answer:
Not natively. Cypress is designed to work within a single browser tab.

Q5. What languages does Cypress support?

  • JavaScript
  • TypeScript

Q6. Can Cypress perform API testing?

Answer:
Yes. It provides the cy.request() command for API testing.

Q7. What are Cypress fixtures?

Answer:
Fixtures are files (typically JSON) used to store reusable test data.

Q8. What are custom commands?

Answer:
Custom commands allow you to create reusable functions in commands.js to reduce code duplication.

4. Web driver IO Interview Q&A

Q1. What is Web driver IO?

Answer:
Web driver IO is a Node.js automation framework that supports both Selenium WebDriver and Chrome Dev Tools Protocol (CDP).

Q2. Which languages are supported?

  • JavaScript
  • TypeScript

Q3. Does Web driver IO support Appium?

Answer:
Yes. It integrates with Appium for mobile application testing.

Q4. Can Web driver IO run tests in parallel?

Answer:
Yes. It supports parallel execution using multiple workers.

Q5. What reporting tools are supported?

  • Allure
  • Spec Reporter
  • JUnit
  • JSON Reporter

Q6. What are services in WebdriverIO?

Answer:
Services extend functionality, such as integrating with Selenium Standalone, Appium, or cloud providers like BrowserStack.

5. TestComplete Interview Q&A

Q1. What is TestComplete?

Answer:
TestComplete is a commercial automation tool from SmartBear for web, desktop, and mobile application testing.

Q2. Does TestComplete require programming?

Answer:
No. It supports record-and-playback and keyword-driven testing, though scripting is also available.

Q3. What scripting languages are supported?

  • JavaScript
  • Python
  • VBScript
  • DelphiScript
  • C++
  • C#

Q4. What is Keyword Testing?

Answer:
Keyword Testing allows test cases to be built using predefined actions without writing code.

Q5. What is Object Spy?

Answer:
Object Spy identifies UI elements and their properties for use in automated tests.

6. Katalon Studio Interview Q&A

Q1. What is Katalon Studio?

Answer:
Katalon Studio is an automation platform built on Selenium and Appium that supports web, mobile, API, and desktop testing.

Q2. Is Katalon open source?

Answer:
It offers a free edition, while advanced enterprise features require a paid license.

Q3. What frameworks does Katalon support?

  • Data-Driven Testing
  • Keyword-Driven Testing
  • BDD

Q4. Can Katalon perform API testing?

Answer:
Yes. It includes built-in API request creation, validation, and reporting.

Q5. Which language does Katalon use?

Answer:
Groovy (built on Java).

7. Robot Framework Interview Q&A

Q1. What is Robot Framework?

Answer:
Robot Framework is an open-source keyword-driven automation framework primarily developed in Python.


Q2. What is Keyword-Driven Testing?

Answer:
Tests are created using readable keywords instead of programming code, making them easier for non-programmers to understand.


Q3. Which libraries are commonly used?

  • SeleniumLibrary
  • AppiumLibrary
  • RequestsLibrary
  • DatabaseLibrary

Q4. Does Robot Framework generate reports?

Answer:
Yes. It automatically generates HTML reports and logs after execution.


Q5. Which language is Robot Framework based on?

Answer:
Python.


8. Puppeteer Interview Q&A

Q1. What is Puppeteer?

Answer:
Puppeteer is a Node.js library developed by Google to automate Chrome and Chromium browsers using the Chrome DevTools Protocol.


Q2. What is Headless Mode?

Answer:
Headless mode runs the browser without displaying a graphical user interface, making automation faster and suitable for CI/CD pipelines.


Q3. What are common uses of Puppeteer?

  • Browser automation
  • Web scraping
  • Screenshot capture
  • PDF generation
  • Performance testing

Q4. Which browsers are supported?

Primarily:

  • Chrome
  • Chromium

Firefox support is limited compared to Chrome.


Q5. Difference between Puppeteer and Selenium?

PuppeteerSelenium
Uses Chrome DevTools ProtocolUses WebDriver protocol
Best for Chrome/ChromiumSupports multiple browsers
Faster for Chrome automationBetter for cross-browser testing
JavaScript onlyMultiple programming languages

Common Comparison Questions

Q1. Selenium vs Playwright

SeleniumPlaywright
Uses WebDriverUses browser automation APIs
Requires explicit waitsAuto-waiting built in
Cross-browserChromium, Firefox, WebKit
Mature ecosystemModern features and faster execution

Q2. Selenium vs Cypress

SeleniumCypress
Multiple languagesJavaScript/TypeScript only
Uses WebDriverRuns inside the browser
Better cross-browser supportExcellent debugging and developer experience

Q3. Playwright vs Cypress

PlaywrightCypress
Supports multiple browser enginesPrimarily Chromium-based workflow
Multi-tab supportLimited multi-tab support
Browser contextsSingle browser context model
Built-in API testingAPI testing with cy.request()

Frequently Asked HR/Technical Question

Q: Which automation tool would you choose for a new project and why?

Sample Answer:

My choice depends on the project requirements. If the team uses Java and needs broad browser compatibility, Selenium is a strong choice because of its mature ecosystem. For modern web applications where speed, reliability, and built-in features like auto-waiting and tracing are important, I would choose Playwright. If the application is built with JavaScript and the team wants fast end-to-end testing with excellent debugging, Cypress is a great option. The selection should align with the technology stack, team expertise, and long-term maintenance needs.

Here’s how interviewers usually view each skill:

Skill

Why companies ask for it

Selenium

Industry-standard web automation

Playwright

Modern, faster, more reliable automation

API Testing

Backend validation is mandatory in most projects

TestNG

Test execution control, grouping, parallel runs

Maven

Dependency and build management

Jenkins

CI/CD automation

Git

Code collaboration and version control

SQL

Data validation and troubleshooting

The “complete automation engineer” picture

Think of a real project flow:

Selenium / Playwright

TestNG

Maven

Git

Jenkins

SQL

API Testing

If you can explain this end-to-end flow in an interview, you will sound much stronger than someone who only knows Selenium.

What you should know in each area (interview checklist)

1. Selenium (must know)

Core questions

  • What is WebDriver?

  • Difference between Selenium 3 and 4?

  • How do you handle dynamic elements?

  • Explicit wait vs Implicit wait?

  • Page Object Model?

  • Parallel execution?

  • Handling alerts, frames, windows?

One-line answer

Selenium automates web browsers using browser-specific drivers and is best for cross-browser UI automation.

Practical code they may ask

WebDriver driver = new ChromeDriver();
driver.get("https://example.com");
driver.findElement(By.id("login")).click();

2. Playwright (very high demand now)

Core questions

  • Why Playwright over Selenium?

  • What is auto-waiting?

  • Browser context?

  • Network interception?

  • Parallel execution?

  • Trace viewer?

Strong answer

Playwright provides built-in auto-waiting, browser isolation through contexts, parallel execution, tracing, and better handling of modern JavaScript applications.

Example

Playwright playwright = Playwright.create();
Browser browser = playwright.chromium().launch();
Page page = browser.newPage();
page.navigate("https://example.com");
page.click("text=Login");

3. API Testing (mandatory)

Most companies now ask API questions even for UI roles.

Must know

  • GET, POST, PUT, PATCH, DELETE

  • Status codes (200, 201, 400, 401, 403, 404, 500)

  • Headers

  • Authentication (Bearer token)

  • JSON validation

Example answer

Q: Difference between PUT and PATCH?

  • PUT = full update

  • PATCH = partial update

Postman / Rest Assured example

given()
  .header("Authorization", "Bearer token")
.when()
  .get("/users")
.then()
  .statusCode(200);

4. TestNG

Must know

  • @Test

  • @BeforeMethod

  • @AfterMethod

  • @DataProvider

  • Groups

  • Priorities

  • Parallel execution

  • testng.xml

Example

@Test(dataProvider = "loginData")
public void login(String user, String pass) {
    // test
}

Interview question

Q: Why TestNG?

It provides annotations, grouping, dependency management, data-driven testing, and parallel execution.

5. Maven

Must know

  • pom.xml

  • Dependencies

  • Plugins

  • Maven lifecycle

  • mvn test

Important lifecycle

  • validate

  • compile

  • test

  • package

  • install

  • deploy

Interview answer

Maven manages project dependencies and automates build and test execution.

6. Jenkins

This is where many QA candidates become weak.

Must know

  • What is CI/CD?

  • How do you trigger automation from Jenkins?

  • What is a pipeline?

  • How do you schedule nightly execution?

  • How do you publish reports?

Basic pipeline

pipeline {
  agent any
  stages {
    stage("Test") {
      steps {
        sh "mvn test"
      }
    }
  }
}

Strong answer

Jenkins continuously executes automation suites on code changes or schedules and publishes reports for the team.

7. Git

Must know commands

git clone
git status
git add .
git commit -m "message"
git push
git pull
git checkout -b branch

Interview question

Q: Difference between pull and fetch?

  • fetch = download changes

  • pull = fetch + merge

Explain workflow

  • Create branch

  • Commit changes

  • Push branch

  • Create pull request

  • Merge after review

8. SQL (very important)

QA engineers are often asked to validate database data.

Must know

Query

Use

SELECT

Read data

WHERE

Filter rows

ORDER BY

Sort

GROUP BY

Aggregate

JOIN

Combine tables

COUNT

Count records

Example

SELECT u.name, o.order_id
FROM users u
JOIN orders o ON u.id = o.user_id;

Interview question

Q: Types of joins?

  • INNER

  • LEFT

  • RIGHT

  • FULL

The 20 questions you are most likely to get

  • Difference between Selenium and Playwright?

  • How do you handle dynamic XPath?

  • Explicit wait vs Fluent wait?

  • What is POM?

  • How do you run tests in parallel?

  • What is Browser Context in Playwright?

  • How do you intercept API calls?

  • Difference between PUT and PATCH?

  • What is TestNG Data Provider?

  • How do you parameterize tests?

  • What is Maven dependency management?

  • Explain Maven lifecycle.

  • How do you integrate Jenkins with Git?

  • What is CI/CD?

  • What is a Jenkins pipeline?

  • Difference between git fetch and git pull?

  • How do you resolve merge conflicts?

  • Write an SQL JOIN query.

  • How do you validate DB data from automation?

  • Describe your automation framework architecture.

The framework answer that impresses interviewers

Use this exact structure:

I designed a hybrid automation framework using Java, Selenium/Playwright, TestNG, and Maven. Test cases are organized using Page Object Model, configurations are managed through property files, execution is controlled by TestNG, dependencies are handled by Maven, source code is stored in Git, Jenkins triggers the suite on every build, and reports are generated using Allure/Extent. Database validations are performed using SQL queries, and API validations are automated using Rest Assured/Postman collections.

That answer sounds like a real QA Lead / Senior Automation Engineer.

What to learn first (30-day roadmap)

Week 1

Selenium + TestNG + Maven

Week 2

Playwright + API Testing

Week 3

Git + SQL

Week 4

Jenkins + framework integration

Spend 2 hours daily and build one mini project.

For your profile specifically

You already have:

  • Manual testing

  • API testing

  • JIRA

  • Burp Suite

  • Agile

  • 6+ years experience

Add:

  • Selenium framework

  • Playwright basics

  • Jenkins pipeline

  • Git workflow

  • SQL joins/subqueries

Then you can confidently apply for:

  • Senior QA Engineer

  • Automation QA Engineer

  • SDET

  • QA Lead

  • Test Automation Lead

Final interview tip

When asked “What technologies do you know?”, don’t list tools only.

Say:

I work across the complete automation stack: Selenium and Playwright for UI automation, Postman/Rest Assured for API validation, TestNG for execution management, Maven for dependency management, Git for version control, Jenkins for CI/CD, and SQL for backend validation.

That single sentence immediately positions you as a full-stack QA automation engineer, not just a manual tester.

yes

Perfect! Based on your 6+ years of QA experience and your goal of clearing Senior QA Automation Engineer / QA Lead interviews, I'll create a complete Automation Testing Course from beginner to advanced, just like a professional training program.

Complete Automation Testing Roadmap 

Module 1: Java for Automation (3 Days)

Topics

  • Java Basics
  • Variables & Data Types
  • Operators
  • If-Else
  • Loops
  • Arrays
  • Strings
  • Methods
  • OOP Concepts
  • Exception Handling
  • Collections
  • File Handling

Mini Project: Student Management System

Module 2: Selenium WebDriver 

Day 1

  • Introduction to Selenium
  • Selenium Architecture
  • Selenium 3 vs Selenium 4
  • Browser Drivers
  • WebDriver Methods

Day 2

  • Locators
    • ID
    • Name
    • ClassName
    • TagName
    • CSS Selector
    • XPath

Day 3

  • XPath
    • Relative XPath
    • Dynamic XPath
    • Axes XPath
    • CSS Selector

Day 4

  • Waits
    • Implicit Wait
    • Explicit Wait
    • Fluent Wait

Day 5

  • Dropdown
  • Checkbox
  • Radio Button
  • Alerts
  • Frames
  • Windows

Day 6

  • Mouse Actions
  • Keyboard Actions
  • Drag & Drop
  • Right Click
  • Double Click

Day 7

  • JavaScript Executor
  • Scrolling
  • File Upload
  • File Download

Day 8

  • Data Driven Testing
  • Apache POI
  • Excel Reading

Day 9

  • TestNG
    • Annotations
    • Assertions
    • Groups
    • Data Provider
    • Parallel Execution

Day 10

  • Selenium Framework
    • Page Object Model
    • Page Factory
    • Utility Classes
    • Base Class
    • Reporting
    • Logging

Project: Automate an E-commerce Website

Module 3: Playwright 

Topics

  • Installation
  • Browser Context
  • Locators
  • Auto Waiting
  • Frames
  • Multiple Tabs
  • API Testing
  • Network Mocking
  • Trace Viewer
  • Screenshots
  • Videos
  • Parallel Testing
  • Page Object Model
  • CI/CD

Project: Automate Amazon Search & Checkout Flow

Module 4: API Testing 

REST API Concepts

  • Client & Server
  • HTTP
  • HTTPS
  • REST
  • SOAP
  • JSON
  • XML

HTTP Methods

  • GET
  • POST
  • PUT
  • PATCH
  • DELETE

Authentication

  • Basic Auth
  • Bearer Token
  • OAuth 2.0
  • JWT

Status Codes

  • 200
  • 201
  • 204
  • 400
  • 401
  • 403
  • 404
  • 409
  • 500

Postman

  • Collections
  • Variables
  • Environment
  • Pre-request Scripts
  • Test Scripts
  • Newman

REST Assured

  • GET Request
  • POST Request
  • Assertions
  • JSONPath

Project: Employee Management API Testing

Module 5: SQL 

Basics

  • SELECT
  • INSERT
  • UPDATE
  • DELETE

Filtering

  • WHERE
  • ORDER BY
  • GROUP BY
  • HAVING

Joins

  • INNER JOIN
  • LEFT JOIN
  • RIGHT JOIN
  • FULL JOIN
  • SELF JOIN

Advanced

  • Subquery
  • Window Functions
  • Stored Procedures
  • Indexes

Project: Database Validation for Automation

Module 6: Maven 

Topics

  • pom.xml
  • Dependencies
  • Plugins
  • Surefire Plugin
  • Maven Commands
  • Maven Lifecycle

Module 7: Git & GitHub

Topics

  • Repository
  • Clone
  • Commit
  • Push
  • Pull
  • Fetch
  • Merge
  • Rebase
  • Branching Strategy
  • Pull Request

Project: Push Selenium Framework to GitHub

Module 8: Jenkins

Topics

  • CI/CD
  • Installation
  • Maven Integration
  • Git Integration
  • Build Pipeline
  • Scheduled Execution
  • Email Reports
  • Allure Reports

Project: Execute Automation Suite from Jenkins

Module 9: Framework Design 

You'll build a real Hybrid Framework including:

AutomationFramework/

src/main/java

Pages

Utilities

Base

Listeners

Reports

Config

src/test/java

TestCases

Resources

Config.properties

testng.xml

pom.xml

Framework Features:

  • Selenium
  • Java
  • TestNG
  • Maven
  • Page Object Model
  • Utility Classes
  • Excel Utility
  • Config Reader
  • Screenshot Utility
  • Log4j
  • Extent Report
  • Allure Report
  • Retry Analyzer
  • Jenkins Integration
  • Git Integration

Module 10: Live Projects

Project 1

OrangeHRM Automation

Skills:

  • Login
  • Employee
  • Leave
  • Reports

Proje

OpenCart

Skills:

  • Registration
  • Login
  • Search
  • Cart
  • Checkout

Project 3

SauceDemo

Skills:

  • Login
  • Cart
  • Checkout

Project 4

Automation Exercise

Skills:

  • Registration
  • Product Search
  • Cart
  • Payment Flow

Project 5

REST API Project

Automate:

  • Employee API
  • User API
  • Product API

Coding Practice

You'll write automation scripts for:

  • Login Page
  • Registration Form
  • Dynamic Table
  • Calendar
  • File Upload
  • File Download
  • Broken Links
  • Shadow DOM
  • iFrames
  • Multiple Windows
  • Alerts
  • Drag & Drop
  • Dynamic XPath
  • Data-Driven Tests
  • Parallel Execution


Testing Profile Q&A

 Scenario 1: Handling Conflicts Within the Team Q: One of your QA team members is in constant disagreement with a developer, leading to dela...