This is a real ValueLabs automation testing interview, organised by topic with a model answer for every question. The round is broad rather than deep: after your introduction and project, the interviewer moves quickly across framework design, Selenium, Cucumber, TestNG, API testing, Git and Jenkins — so it tests your whole automation profile.

How the Round Flows

  1. Self-introduction and project explanation.
  2. Your automation framework and design patterns.
  3. Selenium and Cucumber, often with small code snippets.
  4. TestNG and reporting.
  5. API, Git, Jenkins and general QA process.

Prepare a two-minute framework walkthrough first — most follow-up questions come from it. See How to Explain Your Automation Framework.

Advertisement

Framework & Design Patterns

Explain your automation framework and its components.

Give the type and stack (e.g. hybrid framework with Selenium, Java, TestNG/Cucumber, Maven, POM), then the components: base classes and a driver factory, page objects, tests or step definitions, test data and configuration, utilities (waits, screenshots), reporting, and CI with Jenkins. End with one challenge you solved.

What is the Page Object Model? Advantages and disadvantages?

Each page is a class holding its locators and actions; tests call page methods instead of Selenium commands.

  • Advantages: reusable code, one place to update locators, readable tests, less duplication.
  • Disadvantages: more classes and boilerplate, and large pages produce very large page classes — solved by splitting reusable components (header, search, modal) into their own classes.

More: Frameworks & Page Object Model.

What is the Singleton design pattern, and where do you use it?

A creational pattern that guarantees only one instance of a class and gives global access to it — using a private constructor and a static accessor. In frameworks it's typically used for configuration readers and loggers:

public final class ConfigReader {
    private static ConfigReader instance;
    private final Properties props = new Properties();

    private ConfigReader() {                       // private: no "new ConfigReader()" elsewhere
        try (InputStream in = new FileInputStream("src/test/resources/config.properties")) {
            props.load(in);
        } catch (IOException e) {
            throw new IllegalStateException("Cannot load config", e);
        }
    }

    public static synchronized ConfigReader getInstance() {
        if (instance == null) instance = new ConfigReader();
        return instance;
    }

    public String get(String key) { return props.getProperty(key); }
}

Interview tip: a single shared WebDriver breaks parallel execution. If asked about Singleton for WebDriver, explain that you use one driver per thread with ThreadLocal<WebDriver> instead.

Explain WebDriver driver = new ChromeDriver();

WebDriver is an interface and ChromeDriver is a class that implements it (through RemoteWebDriver). The interface reference — upcasting — lets the same code run on any browser by changing only the object created. See Selenium WebDriver Fundamentals.

Explain the Maven lifecycle.

The default lifecycle runs phases in order: validate → compile → test → package → verify → install → deploy. Running a phase runs all earlier ones, so mvn test compiles and then runs tests through the Surefire plugin; mvn clean (a separate lifecycle) deletes target/. More: Maven for Selenium.

Selenium & Cucumber

What is Selenium Grid?

A way to run tests in parallel on many browsers, versions and machines. Tests connect with RemoteWebDriver to the Grid URL, and the Grid routes each session to a matching node. Selenium 4 Grid can run standalone, as hub and nodes, or fully distributed — often in Docker. See Parallel, Grid & Cross-Browser.

Explain Selenium waits, and write an explicit wait.

Implicit waits apply globally to every element search; explicit waits wait for a specific condition; fluent waits add a custom polling interval and ignored exceptions. Prefer explicit waits and don't mix them with implicit waits.

WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
wait.until(ExpectedConditions.elementToBeClickable(By.id("submit"))).click();

Write a drag-and-drop example.

WebElement source = driver.findElement(By.id("draggable"));
WebElement target = driver.findElement(By.id("droppable"));
new Actions(driver).dragAndDrop(source, target).perform();

How do you switch between browser windows? Why is a Set used for window handles?

String parent = driver.getWindowHandle();
for (String handle : driver.getWindowHandles()) {
    if (!handle.equals(parent)) driver.switchTo().window(handle);
}

getWindowHandles() returns a Set<String> because every handle is unique — a Set can't contain duplicates.

How do you capture screenshots?

Cast the driver to TakesScreenshot and call getScreenshotAs() — usually inside a TestNG ITestListener.onTestFailure() or a Cucumber @After hook so it only happens on failure.

Scenario vs Scenario Outline? What is the runner file?

A Scenario runs once; a Scenario Outline runs once per row of its Examples table. The runner class (@CucumberOptions) tells Cucumber where the feature files and step definitions (glue) are, which tags to run and which report plugins to use. See Feature Files Explained.

How do you run Cucumber scenarios in parallel?

With TestNG, extend AbstractTestNGCucumberTests and override scenarios() with @DataProvider(parallel = true); keep one WebDriver per scenario (dependency injection or ThreadLocal). See The Complete Cucumber BDD Tutorial.

How do you pass data to your automation scripts?

Through TestNG data providers, Cucumber Examples tables and data tables, external files (Excel with Apache POI, JSON, properties) and data created via APIs. See Data-Driven Testing.

TestNG & Reporting

Explain TestNG annotations and their execution order.

@BeforeSuite → @BeforeTest → @BeforeClass → @BeforeMethod → @Test → @AfterMethod → @AfterClass → @AfterTest → @AfterSuite.

How do you re-run failed tests?

Run the generated testng-failed.xml, or attach an IRetryAnalyzer for automatic retries of genuinely unstable tests.

How do you run one test several times?

@Test(invocationCount = 5) — optionally with threadPoolSize to run the invocations in parallel.

How do you prioritise tests?

@Test(priority = 1) — lower numbers run first. Prefer independent tests over relying on order.

How do you generate and customise reports?

TestNG creates emailable-report.html and index.html; most teams use Extent Reports or Allure through listeners, adding screenshots, logs and environment details. See TestNG Interview Questions.

API, Git, Jenkins & QA Process

201 vs 204? 401 vs 403?

201 Created — a resource was created (typical for POST). 204 No Content — success with an empty body (often DELETE). 401 — not authenticated (missing or invalid credentials). 403 — authenticated but not allowed.

What are the components of an API request? Query vs path parameter?

Method, endpoint URL, headers, query/path parameters and body. A path parameter identifies a resource (/users/42); a query parameter filters or modifies the request (/users?page=2). See The Complete API Testing Tutorial.

How do you resolve Git merge conflicts?

Pull the latest changes, open the conflicted files, choose or combine the changes between the <<<<<<< and >>>>>>> markers, run the tests, then git add and commit. See Git Branching & Merging.

git pull vs git patch?

git pull fetches and merges remote changes into your branch. A patch is a file of changes created with git diff or git format-patch and applied with git apply or git am — used to share changes without pushing to a shared remote.

What is Jenkins' role in your framework?

Jenkins pulls the code from Git, runs mvn clean test on a schedule or on every push, publishes reports and screenshots, and notifies the team. See The Complete Jenkins Tutorial.

Explain the defect life cycle. Agile vs Waterfall?

New → Assigned → In Progress → Fixed → Retest → Closed, with Reopened, Rejected, Duplicate and Deferred as other outcomes (Defect Management). Waterfall runs phases sequentially with testing near the end; Agile delivers in short iterations with testing inside every sprint (Agile vs Waterfall).

More Questions to Prepare

Which Selenium exceptions have you faced, and how did you fix them?

NoSuchElementException (wrong locator or not loaded yet — fix the locator, add an explicit wait), StaleElementReferenceException (DOM re-rendered — find the element again), ElementClickInterceptedException (an overlay — wait for it to disappear), TimeoutException (condition never met — check the condition and the app) and NoSuchFrameException (switch into the frame first). See Selenium Errors & Exceptions.

How do you handle an iframe and a dropdown?

new WebDriverWait(driver, Duration.ofSeconds(10))
        .until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.id("payment-frame")));
// … work inside the frame …
driver.switchTo().defaultContent();

new Select(driver.findElement(By.id("country"))).selectByVisibleText("India");

Write a program to count how often each character occurs in a string.

Map<Character, Integer> counts = new LinkedHashMap<>();
for (char c : "automation".toCharArray()) counts.merge(c, 1, Integer::sum);
// {a=2, u=1, t=2, o=2, m=1, i=1, n=1}

More coding programs: Java String Programs.

HashMap vs Hashtable?

HashMap isn't synchronised, allows one null key and null values, and is faster; Hashtable is synchronised (legacy) and allows no nulls. For thread-safe maps today, use ConcurrentHashMap.

Write a query for the second-highest salary.

SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees);

How do you decide what to automate?

Stable, frequently run, business-critical scenarios first — smoke, regression and API checks — while exploratory, usability and rapidly changing features stay manual. See Manual vs Automation Testing.

How to Prepare

  • Be able to write the explicit wait, window switching, drag-and-drop and screenshot snippets from memory.
  • Prepare a clear answer on POM's downsides and on Singleton vs ThreadLocal — they separate strong candidates.
  • Revise with Top 50 Selenium Questions and Top 30 API Questions.

Rehearse answers under time pressure in the Selenium Interview Simulator.

From Real Projects

In interviews for testing and automation roles, I've found the questions come back to real work: the application you tested, how you wrote and reviewed test cases, how you tracked execution and defects (for me, TestRail and Jira), and how your automation was structured (Selenium, Java, TestNG, POM and a business library). Prepare one short, honest example from your own projects for each topic on this page. On Canolog, every department — sales, inventory, finance, service and parts — connects to the others, so a change in one module had to be checked in the flows that depend on it. Prepare your framework explanation and two Java programs you can write from memory.

📚 Official documentation: ISTQB Glossary of testing terms

FAQs

What does the ValueLabs automation interview cover?

Introduction and project, your framework and design patterns, Selenium and Cucumber, TestNG, API testing, Git and Jenkins, and general QA process.

Is Singleton used for WebDriver?

Sometimes in single-threaded frameworks, but it prevents parallel runs. Most modern frameworks use a ThreadLocal driver factory and keep Singleton for configuration and logging.

Why does getWindowHandles() return a Set?

Because window handles are unique, and a Set cannot hold duplicates.

How should I prepare?

Rehearse your framework explanation, practise the common Selenium snippets and review TestNG, API status codes, Git conflicts and the Maven lifecycle. See The Complete SDET Interview Guide.