Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.
Solved for CapgeminiStart 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.
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.
final makes a variable, method or class unchangeable; finally is a block that always runs after try-catch; finalize is a deprecated method called before garbage collection.
11
Write an XPath for a button with the text "Login".
@DataProvider returns Object[][]; a @Test(dataProvider = "name") method runs once per row — the basis of data-driven tests, often reading Excel or JSON.
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.
Automate stable, repetitive, high-risk and data-heavy flows (smoke, regression). Skip one-time tests, frequently changing UI and checks needing human judgement. Compare run frequency × manual time with build and maintenance cost.
19
What are the advantages of version control for test code?
Continuous Integration builds and tests every commit, and Continuous Delivery ships automatically. Automated tests give fast feedback and gate releases.
26
How would you design a CI pipeline for nightly regression?
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.
String parent = driver.getWindowHandle();
for (String h : driver.getWindowHandles())
if (!h.equals(parent)) driver.switchTo().window(h);
// ...then switch back to parent
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.
37
Difference between an abstract class and an interface?
An abstract class can hold state and concrete methods; an interface defines a contract (with default methods since Java 8). A class extends one abstract class but can implement many interfaces.
38
What is the difference between hard and soft assertions?
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.
46
What is method overriding and where is it useful in frameworks?
Lambdas are short anonymous functions; streams process collections declaratively with filter, map and collect, for example filtering link text from a list of elements.
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.