Skip to content

Wipro Automation Testing Interview Questions & Answers

Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.

Solved for WiproStart practicing
3 QUESTIONS FREESign up or log in to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
3 questions free Unlock the rest in seconds
01

How would you automate a login flow with multiple user roles?

Save to ▾
Show answer
Keep credentials in external data, parameterise the test with a data provider, reuse a login method in a page class, and clear sessions between roles.
02

What is the difference between driver.close() and driver.quit()?

WiproMedium
Save to ▾
Show answer
close() closes the current window; quit() closes all windows and ends the driver session.
03

How do you handle a website that uses CAPTCHA?

WiproHard
Save to ▾
Show answer
Do not automate it; ask for a test environment where CAPTCHA is disabled or use test keys, or a bypass token agreed with developers.
04

How do you pass parameters from testng.xml?

WiproMedium
Save to ▾
Show answer
Define parameter name and value in the XML and read them with @Parameters in the test or configuration method.
05

List common TestNG annotations and their order.

WiproEasy
Save to ▾
Show answer
BeforeSuite, BeforeTest, BeforeClass, BeforeMethod, Test, AfterMethod, AfterClass, AfterTest and AfterSuite.
06

How do you run tests in parallel?

WiproMedium
Save to ▾
Show answer
Use TestNG parallel="methods | classes | tests" with thread-count, keep WebDriver in a ThreadLocal, and use Selenium Grid or a cloud grid for multiple browsers.
07

What is the purpose of testng.xml?

WiproEasy
Save to ▾
Show answer
A configuration file to define suites, tests, classes, groups, parameters and parallel execution settings.
08

What is OAuth 2.0 in API testing?

WiproMedium
Save to ▾
Show answer
An authorisation framework where a client obtains an access token from an auth server and sends it as a Bearer token; tests fetch and reuse the token in setup.
09

What is the difference between throw and throws?

WiproMedium
Save to ▾
Show answer
throw actually raises an exception object inside a method; throws declares in the method signature that it may pass an exception to the caller.
10

How do you verify response time and headers in REST Assured?

WiproMedium
Save to ▾
Show answer
Use then().time(lessThan(2000L)) and then().header("Content-Type", containsString("json")) along with body assertions.
11

How do you switch between windows and tabs?

WiproMedium
Save to ▾
Show answer
Get getWindowHandles(), loop to find the target, and call driver.switchTo().window(handle); switch back using the stored parent handle.
12

What is the difference between an array and an ArrayList?

WiproMedium
Save to ▾
Show answer
Arrays have a fixed size and can hold primitives; ArrayList grows dynamically, holds objects and offers helper methods.
13

What is the difference between @BeforeTest and @BeforeMethod?

WiproMedium
Save to ▾
Show answer
@BeforeTest runs once before all methods in a test tag of testng.xml; @BeforeMethod runs before every test method.
14

What is the difference between == and equals() in Java?

WiproEasy
Save to ▾
Show answer
== compares references (or primitive values); equals() compares content when overridden, as in String.
15

What is Postman and how do you automate with it?

WiproMedium
Save to ▾
Show answer
An API client. Add tests in JavaScript, use environments and collections, and run them with Newman in a CI pipeline.
16

What is contract testing?

WiproMedium
Save to ▾
Show answer
Verifying that a provider and consumer agree on request and response formats, using tools like Pact, to catch breaking changes early.
17

What is the difference between Comparable and Comparator in Java?

WiproMedium
Save to ▾
Show answer
Comparable defines the natural order inside the class (compareTo); Comparator defines custom orders externally (compare), useful for sorting test data in several ways.
18

How do you test an API that depends on another service that is down?

WiproMedium
Save to ▾
Show answer
Use mocks or stubs such as WireMock to simulate the dependency and test your service in isolation.
19

What is the difference between getText() and getAttribute()?

WiproMedium
Save to ▾
Show answer
getText returns visible inner text; getAttribute returns an HTML attribute or property such as value, href or class.
20

How do you handle a test that is flaky only in headless mode?

WiproMedium
Save to ▾
Show answer
Set window size explicitly, use proper waits, check animations and viewport differences, and capture screenshots and logs to find timing issues.
21

How do you validate a JSON response in REST Assured?

WiproMedium
Save to ▾
Show answer
Use then().statusCode(200).body("data.id", equalTo(5)), or extract() the response and assert fields with JsonPath.
22

How do you handle StaleElementReferenceException?

WiproMedium
Save to ▾
Show answer
Re-locate the element after the DOM refreshes, use explicit waits for the refreshed element, don't keep element references for long, or wrap the action in retry logic.
23

What is CI/CD and why does automation need it?

WiproMedium
Save to ▾
Show answer
Continuous Integration builds and tests every commit, and Continuous Delivery ships automatically. Automated tests give fast feedback and gate releases.
24

Implicit vs explicit vs fluent wait?

WiproEasy
Save to ▾
Show answer
Implicit wait applies globally to element lookups. Explicit wait waits for a specific condition (WebDriverWait + ExpectedConditions). Fluent wait is an explicit wait with custom polling and ignored exceptions.
25

What are the Actions class use cases?

WiproMedium
Save to ▾
Show answer
Mouse and keyboard actions such as hover, drag and drop, double click, right click and key combinations, built with moveToElement(...).perform().
26

Method overloading vs overriding?

WiproEasy
Save to ▾
Show answer
Overloading: same method name, different parameters, in the same class (compile time). Overriding: a subclass redefines a parent method with the same signature (runtime polymorphism). WebDriver driver = new ChromeDriver() is runtime polymorphism.
27

What is Docker and how does it help tests?

WiproMedium
Save to ▾
Show answer
Docker packages tools in containers so tests run identically everywhere; Selenium Grid and browsers can be started quickly in containers.
28

Write an XPath for a button with the text "Login".

WiproEasy
Save to ▾
Show answer
//button[normalize-space()='Login'] //button[contains(text(),'Login')]
29

Tests pass locally but fail on Jenkins. Why?

WiproHard
Save to ▾
Show answer
Headless mode or screen resolution, timing issues, environment data, missing dependencies, browser–driver version mismatch or parallel conflicts. Check logs and failure screenshots and make waits robust.
30

How do you calculate automation ROI?

WiproHard
Save to ▾
Show answer
Compare effort saved by running automated tests repeatedly against the cost of building and maintaining scripts, counting execution time, defects found earlier and release speed.
31

Explain your CI/CD pipeline for tests.

WiproHard
Save to ▾
Show answer
Code pushed to Git → Jenkins job triggers (webhook or schedule) → mvn clean test with the suite XML → reports and screenshots published → notifications on Slack/email → failures triaged before release.
32

Common HTTP status codes?

WiproEasy
Save to ▾
Show answer
200 OK, 201 Created, 204 No Content, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 500 Internal Server Error.
33

Where do you use OOP concepts in your framework?

WiproMedium
Save to ▾
Show answer
Encapsulation: private locators with public page methods. Inheritance: pages extend a BasePage. Polymorphism: the WebDriver interface for different browsers. Abstraction: utility layers hiding Selenium details.
34

What is the difference between hard and soft assertions?

WiproMedium
Save to ▾
Show answer
Hard assert stops the test at the first failure; SoftAssert collects failures and reports them together when assertAll() is called.
35

What are the different types of waits in Selenium?

WiproMedium
Save to ▾
Show answer
Implicit, explicit (WebDriverWait with ExpectedConditions) and fluent waits; avoid mixing implicit and explicit waits and never rely on Thread.sleep.
36

What is BDD and how does Cucumber work?

WiproMedium
Save to ▾
Show answer
Behaviour-driven development writes scenarios in Given-When-Then Gherkin that map to step definitions in code, so business and QA share one language.
37

How do you handle a web table in Selenium?

WiproMedium
Save to ▾
Show answer
Locate rows and columns with XPath such as //table//tr and //td, loop through them to read or click cells, or build the XPath dynamically from the row text.
38

What do HTTP status codes 200, 201, 400, 401, 403, 404 and 500 mean?

WiproEasy
Save to ▾
Show answer
200 OK, 201 Created, 400 bad request, 401 unauthenticated, 403 forbidden, 404 not found and 500 server error.
39

findElement vs findElements?

WiproEasy
Save to ▾
Show answer
findElement returns the first match and throws NoSuchElementException if nothing is found. findElements returns a List (empty if nothing is found) — handy to check whether an element exists.
40

Difference between absolute and relative XPath?

WiproMedium
Save to ▾
Show answer
Absolute starts from the root (/html/...) and breaks easily; relative starts anywhere with // and is more stable, for example //input[@id='email'].
41

How do you handle environment-specific configuration?

WiproMedium
Save to ▾
Show answer
Keep URLs and credentials in per-environment config files or variables, choose with a command-line parameter and never hard-code secrets.
42

Write a GET test in REST Assured.

WiproMedium
Save to ▾
Show answer
given().baseUri(url) .when().get("/users/1") .then().statusCode(200).body("id", equalTo(1));
43

What is an API and what are common HTTP methods?

WiproEasy
Save to ▾
Show answer
An interface for systems to talk to each other. GET reads, POST creates, PUT replaces, PATCH updates partially and DELETE removes.
44

What are access modifiers in Java?

WiproMedium
Save to ▾
Show answer
public (everywhere), protected (package and subclasses), default (package) and private (same class), used to control visibility of test utilities.
45

What are relative locators in Selenium 4?

WiproMedium
Save to ▾
Show answer
Locators such as above, below, toLeftOf and near that find elements by their position relative to another element.
46

What is a constructor and can it be overloaded?

WiproMedium
Save to ▾
Show answer
A special method that initialises an object. It can be overloaded with different parameters, and testers use it to pass the WebDriver into page classes.
47

What locators does Selenium support?

WiproEasy
Save to ▾
Show answer
id, name, className, tagName, linkText, partialLinkText, CSS selector and XPath. Prefer stable ids or CSS, using XPath when needed.
48

How do you handle alerts and pop-ups?

WiproMedium
Save to ▾
Show answer
driver.switchTo().alert() lets you accept, dismiss, read text or send keys. Browser windows are handled with window handles.
49

How would you design an automation framework from scratch?

WiproHard
Save to ▾
Show answer
Maven project → POM with a BasePage → driver factory with ThreadLocal → config files → data-driven utilities (Excel/JSON) → TestNG or Cucumber runner → logging → Extent reports with screenshots on failure → Jenkins pipeline.
50

How do you scroll a page in Selenium?

WiproMedium
Save to ▾
Show answer
Use JavascriptExecutor with window.scrollTo or scrollIntoView, or the Actions class scroll methods in Selenium 4.
51

What is a Jenkins pipeline?

WiproMedium
Save to ▾
Show answer
A scripted or declarative Jenkinsfile that defines stages such as build, test and deploy as code stored with the project.
52

Reverse a string in Java.

WiproEasy
Save to ▾
Show answer
String r = new StringBuilder(s).reverse().toString(); // or loop from the last index and append each character
53

What are the advantages of version control for test code?

WiproMedium
Save to ▾
Show answer
Git tracks changes, enables code review, branching and rollback and lets teams collaborate on the framework safely.
54

How do you read data from Excel or properties files in Java?

WiproMedium
Save to ▾
Show answer
Use Apache POI for Excel and the Properties class for config files, loaded in a utility class so tests read data instead of hard-coding it.
55

How would you design a CI pipeline for nightly regression?

WiproHard
Save to ▾
Show answer
Schedule the job, spin up environments or containers, run suites in parallel, store reports and screenshots, notify failures on Slack or email and track trends.
56

How do you group tests?

WiproMedium
Save to ▾
Show answer
Tag tests with groups = {"smoke","regression"} and include or exclude them in testng.xml to run chosen sets.
57

What is REST Assured?

WiproMedium
Save to ▾
Show answer
A Java library that makes API tests readable using given-when-then, with easy request building, response validation and JSON path support.
58

What is Selenium and what are its components?

WiproEasy
Save to ▾
Show answer
An open-source suite for browser automation: WebDriver, IDE, Grid and the older RC. WebDriver controls browsers through their native drivers.
59

What is WebDriver and how does it communicate with the browser?

WiproEasy
Save to ▾
Show answer
WebDriver sends commands over HTTP (W3C protocol) to a browser-specific driver such as chromedriver, which controls the actual browser.