Test Data • Tricky Widgets • Assertions • CI Failures • Owning Automation • 2026

Selenium Interview Questions for 3 Years Experience (2 to 4 Years)

Selenium interviews for three years of experience (two to four years) ask less about what a wait is and more about what you did: how you made test data work on every run, how you handled a date picker or a disappearing toast, how you traced a crash that only happened in CI, and what code review taught you. It is written for automation testers with about two to four years of Selenium work, the stage where you own the tests for a feature but someone else still designs the framework. Each question shows what the interviewer is checking, the shape of a good answer and a short spoken answer, with Java examples. Swap in your own stories.

Search all questions by round, difficulty and level, or save the ones you want to practice.

Test Data and State 4 questions

Medium Coding round Mid-level Practice question

1. Your sign-up test passes once and then fails on every rerun because the email is already taken. How did you make its data work on every run, including parallel runs?

What the interviewer is really testing:
Whether you generate unique data safely, know a timestamp can repeat across parallel threads, and keep the data easy to trace.
Answer frame:

Unique per run: build the email from a random part, not a fixed string.

Safe in parallel: a millisecond timestamp can repeat across threads; a random UUID part will not in practice.

Traceable: a clear prefix and the test name, so you can find and clean up test records.

Sample spoken answer:

“The first version used a fixed email, so it only worked on a fresh database. My quick fix was adding the current time in milliseconds, and that worked until we turned on parallel runs, when two threads sometimes got the same millisecond and one test failed as a duplicate. Now I have a small helper that builds the email from a short prefix, the test name and part of a random UUID. The prefix, autotest, means we can spot these accounts and clean them up with one query or API call, and the test name tells me which test made a record when I look at it later. I log the generated email at the start of the test, so if it fails I can log in as that user and look around.”

Code:
public static String uniqueEmail(String testName) {
    String id = UUID.randomUUID().toString().replace("-", "").substring(0, 12);
    return "autotest+" + testName.toLowerCase() + "-" + id + "@example.com";
}
// uniqueEmail("signup") gives something like autotest+signup-3f9c1a2b7d4e@example.com
Red flag to avoid:

Deleting the user by hand before each run, or adding a timestamp and calling it unique.

They may ask next:
  • What would you do if the app rejects a plus sign in the email address?
  • How do you clean up the accounts these tests create?
Say it in 60 seconds
Medium Technical round Mid-level Practice question

2. After you save a form, the page shows a success message. How did you make your test check that the data was really saved, not just shown on screen?

What the interviewer is really testing:
Whether you know a success message only proves the front end reacted, and you check the stored result through a reload or the API.
Answer frame:

The trap: the message and the updated screen can come from the front end's own state, even when the save failed.

Check the source: reload the page and read the value again, or fetch the record through the API.

Keep it cheap: one persistence check per save flow, not after every field.

Sample spoken answer:

“In one project our profile tests all passed, but a real bug got through: the page showed the new phone number and a Saved message, while the API call behind it was failing quietly and nothing was stored. The screen was just showing the front end's own state. After that I changed the key tests. After saving, the test either reloads the page and reads the field again, or calls the same API the app uses to fetch the profile and checks the stored value. The API check is faster and gives a clearer failure, and the reload check proves the page reads the value back correctly. I don't do this for every field in every test, just once per save flow, so the suite doesn't slow down.”

Code:
profilePage.setPhone("0123 456 789");
profilePage.save();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("[data-testid='saved']")));

driver.navigate().refresh();
assertEquals(profilePage.phone(), "0123 456 789"); // read back after reload
Red flag to avoid:

Treating the success message as proof that the data was saved.

They may ask next:
  • Would you ever query the database directly from a UI test? What are the risks?
  • How would you check that a delete really removed the record?
Say it in 60 seconds
Medium Situational round Mid-level Practice question

3. Your tests use accounts in a shared test environment, and other testers keep changing or deleting that data, so your runs fail. What do you do?

What the interviewer is really testing:
Whether you fix it at the test design level and also talk to people, instead of complaining or blaming others.
Answer frame:

Own your data: each test creates what it needs with a unique name and cleans up after.

Stop relying on seed data: no test assumes a record someone else can touch.

Talk: agree a naming rule or reserved accounts with the team.

Sample spoken answer:

“First I'd accept that in a shared environment I can't expect data to stay the same, so the fix is mostly on my side. I'd change the tests so each one creates its own user and records, with a clear prefix and a random part in the name, and removes them at the end. Anything that really has to be long-lived, like an admin account, I'd agree with the team as reserved, with a clear name so nobody edits it by mistake. I'd bring it up at stand-up without pointing at anyone, just saying our automated runs break when these accounts change, here's what I'm doing and here's what would help. If it keeps happening, I'd ask for a nightly reset or a small environment just for automation.”

Red flag to avoid:

Asking everyone else to stop touching the data while the tests keep depending on it.

They may ask next:
  • What would you do with records your tests created but never cleaned up after a crash?
  • How would you argue for a separate automation environment?
Say it in 60 seconds
Medium Situational round Mid-level Practice question

4. The app is adding a one-time code by email at login and a CAPTCHA on sign-up. Your login tests will break. How do you handle this?

What the interviewer is really testing:
Whether you know not to try to beat a CAPTCHA, and how to work with developers on a safe test path.
Answer frame:

CAPTCHA: don't automate it; ask for it to be off or in test mode in the test environment.

One-time code: read it from a test mailbox API, or use test accounts with a known code in test only.

Coverage: one test of the real code step, the rest log in through a session.

Sample spoken answer:

“A CAPTCHA exists to stop automation, so trying to solve it in a test is the wrong fight. I'd go to the developers before it's released and ask for it to be switched off or put in its provider's test mode in our test environments, never in production. For the email code, I'd pick one of two ways. Either the test reads the email through the API of a test mailbox service and pulls the code out, or test accounts in the test environment get a fixed code. I'd keep one or two tests that go through the full code step using the mailbox, so the real flow is covered, and every other test would skip login by injecting a session. I'd also check the bypass is guarded by environment config, so it can't leak into production.”

Red flag to avoid:

Planning to solve the CAPTCHA with image recognition, or asking for the check to be removed everywhere.

They may ask next:
  • How would you make sure the test-only bypass can never be turned on in production?
  • If the code came by SMS instead, what options would you look at?
Say it in 60 seconds

Everyday WebDriver 5 questions

Medium Coding round Mid-level Practice question

5. A booking form has a calendar date picker, and the input won't accept typed text. Write the steps to pick a date 45 days from today.

What the interviewer is really testing:
Whether you compute the date in code, move the calendar to the right month with a stop condition, and pick the day without matching the wrong cell.
Answer frame:

Compute the date: with the date API, never a hard-coded day that expires.

Move to the month: click next and wait for the header to change, until it shows the target month, with a limit.

Pick the day: by a stable attribute holding the full date, not just the day number.

Sample spoken answer:

“First I work out the target with LocalDate, today plus 45 days, so the test never goes stale. Then I open the calendar and read the month header. While it doesn't match the target month and year, I click next and wait for the header text to change, because reading it straight after the click can give the old month and make the loop click too far. I cap it at about twenty clicks so a broken widget can't loop forever. For the day, I learned not to find the cell by its number alone, because calendars often show greyed days from the months either side, so there can be two cells with the same number. Ours had a data-date attribute with the full date, so I pick by that, then check the input shows the date I expect.”

Code:
LocalDate target = LocalDate.now().plusDays(45);
String wanted = target.format(DateTimeFormatter.ofPattern("MMMM yyyy", Locale.ENGLISH));
By header = By.cssSelector(".calendar-header");
By next = By.cssSelector(".calendar-next");
driver.findElement(By.id("check-in")).click();
for (int i = 0; i < 20; i++) {
    String shown = driver.findElement(header).getText();
    if (shown.equals(wanted)) break;
    driver.findElement(next).click();
    wait.until(d -> !d.findElement(header).getText().equals(shown));
}
assertEquals(driver.findElement(header).getText(), wanted);
driver.findElement(By.cssSelector("[data-date='" + target + "']")).click();
Red flag to avoid:

Hard-coding a date that will expire, or clicking the first cell whose text is the day number.

They may ask next:
  • How would you handle a range picker where you choose check-in and check-out dates?
  • What would you change if the target date can fall on a disabled day?
Say it in 60 seconds
Medium Coding round Mid-level Practice question

6. A city field shows suggestions as you type, and they load from the server. Write the steps to pick one exact suggestion reliably.

What the interviewer is really testing:
Whether you wait for the exact option rather than grabbing the list while it is still changing.
Answer frame:

Type: enough characters to narrow the list.

Wait for the exact option: a locator on its text, waited until clickable.

Confirm: check the field's value after the click.

Sample spoken answer:

“My first version typed a few letters, collected all the suggestion items with findElements and looped to find the right one. It failed now and then with stale element errors, because the list re-renders each time the server answers, and I was holding elements from the older list. What works better is to wait for the exact option directly: a locator that matches the item by its text, with an explicit wait until it's clickable, and then click it. That way each attempt looks the element up fresh. After the click I check the input's value, since some widgets fill the field with a longer label than the suggestion text. And I type enough characters to make the target appear near the top, so it isn't below a scroll area.”

Code:
WebElement city = driver.findElement(By.id("city"));
city.sendKeys("Lond");
By option = By.xpath("//ul[@role='listbox']/li[normalize-space()='London']");
new WebDriverWait(driver, Duration.ofSeconds(10))
    .until(ExpectedConditions.elementToBeClickable(option))
    .click();
assertEquals(city.getDomProperty("value"), "London");
Red flag to avoid:

Pressing the down arrow a fixed number of times and assuming the right item is selected.

They may ask next:
  • What would you do if two suggestions have the same visible text?
  • How would you test that the list shows nothing for a city that doesn't exist?
Say it in 60 seconds
Hard Technical round Mid-level Practice question

7. In your React app, clear() empties a text field, but after you type the new value the old text comes back or the form says the field is empty. What is going on?

What the interviewer is really testing:
Whether you understand that framework-controlled inputs keep their own state and may not see a value set outside normal typing.
Answer frame:

Cause: the input's value lives in the framework's state; clear() can change the DOM without that state updating.

Fix: clear the way a user does, select all then delete, before typing.

Verify: read the value back after typing and check the form accepts it.

Sample spoken answer:

“In a React form the value you see is driven by the component's state. clear() changes the value in the page, but depending on the version and the component, the framework may not treat that as user input, so its state still holds the old text. On the next render the old value comes back, or the validation still thinks the field is empty. I hit this on an edit form in my current project. The fix was to clear it the way a person would: select all with the keyboard and press delete, then type the new value. Because the shortcut is Command on Mac and Control elsewhere, I put that in one helper. After typing I read the value back, and I check the save button enables, which proves the form saw the change.”

Code:
Keys selectAll = System.getProperty("os.name").toLowerCase().contains("mac")
    ? Keys.COMMAND : Keys.CONTROL;
field.sendKeys(Keys.chord(selectAll, "a"), Keys.DELETE);
field.sendKeys("New company name");
assertEquals(field.getDomProperty("value"), "New company name");
Red flag to avoid:

Setting the value with JavaScript and moving on, so the test no longer types like a user.

They may ask next:
  • Why is setting the value with JavaScript usually the wrong fix here?
  • On a Grid, whose operating system decides which shortcut key to use?
Say it in 60 seconds
Medium Technical round Mid-level Practice question

8. After saving, a success toast shows for about two seconds and then disappears. Your check for its text passes sometimes and fails sometimes. How did you make it reliable?

What the interviewer is really testing:
Whether you wait for the right condition, read the text inside the wait window, and know about the wait's polling interval.
Answer frame:

Wait and read in one step: wait for the text to be present rather than finding the element later.

Polling: the default wait polls every half second; poll faster for short-lived elements, and ignore not-found while polling.

Optional: confirm it disappears if that is part of the requirement.

Sample spoken answer:

“The flaky version found the toast, did some other step, then read its text, and by then the toast had gone. I changed it to wait for the text itself, with textToBePresentInElementLocated, so the condition is checked while the toast is on screen. WebDriverWait polls every 500 milliseconds by default, which is fine for most things but is a big slice of a two-second toast, so for these checks I use a FluentWait polling every 100 milliseconds. One catch there: a plain FluentWait doesn't ignore NoSuchElementException the way WebDriverWait does, so I add that, or the wait fails the moment it looks before the toast exists. I also asked the developers for a stable data-testid on the toast, because its classes changed with the message type.”

Code:
By toast = By.cssSelector("[data-testid='toast']");
new FluentWait<>(driver)
    .withTimeout(Duration.ofSeconds(5))
    .pollingEvery(Duration.ofMillis(100))
    .ignoring(NoSuchElementException.class)
    .until(ExpectedConditions.textToBePresentInElementLocated(toast, "Saved"));
Red flag to avoid:

Adding Thread.sleep before reading the text, which makes it miss the toast even more often.

They may ask next:
  • What would you do if the app shows two toasts at once?
  • Would you ever check a toast through a screenshot comparison instead? Why or why not?
Say it in 60 seconds
Hard Coding round Mid-level Practice question

9. A product list loads more items as you scroll, with no pagination. Write a test step that scrolls until a given product appears, and stops if it never does.

What the interviewer is really testing:
Whether you can write a loop that waits for new items after each scroll and has a clear stop condition, instead of scrolling a fixed number of times.
Answer frame:

Loop: while the target is not present, scroll to the bottom.

Wait for growth: after each scroll, wait until the item count goes up.

Stop: if the count stops growing, fail with a clear message.

Sample spoken answer:

“I loop while the product I want isn't on the page. In each pass I count the loaded cards, scroll to the bottom with JavaScript, and then wait a few seconds for the count to go up. If the wait times out, the list has stopped loading, so I fail with a message saying how many cards loaded and that the product wasn't among them. That's much better than scrolling a fixed ten times, which either wastes time or stops too early. Each pass looks the cards up fresh, so there are no stale references. I'd also say to the team that if this list is very long, searching or filtering for the product is a better test path, and the infinite scroll itself gets one small test of its own.”

Code:
By cards = By.cssSelector(".product-card");
By target = By.xpath("//div[contains(@class,'product-card')][.//h3[normalize-space()='Blue Kettle']]");
JavascriptExecutor js = (JavascriptExecutor) driver;
while (driver.findElements(target).isEmpty()) {
    int before = driver.findElements(cards).size();
    js.executeScript("window.scrollTo(0, document.body.scrollHeight);");
    try {
        new WebDriverWait(driver, Duration.ofSeconds(5))
            .until(d -> d.findElements(cards).size() > before);
    } catch (TimeoutException end) {
        throw new AssertionError("Blue Kettle not found; list stopped at " + before + " cards");
    }
}
Red flag to avoid:

Scrolling a fixed number of times with sleeps in between and no clear failure when the item is missing.

They may ask next:
  • How would you add a hard cap so a very long list cannot keep the test running for minutes?
  • Why does the loop look up the cards again on each pass?
Say it in 60 seconds

Checks and Assertions 4 questions

Medium Technical round Mid-level Practice question

10. A test clicks Export and must check the CSV that gets downloaded. How did you make the browser save it somewhere known and wait for it properly?

What the interviewer is really testing:
Whether you know Selenium cannot see the file itself, how to set the download folder through browser options, and how to wait for a finished file.
Answer frame:

Set the folder: browser preferences give a known, empty download directory per run.

Wait right: poll until the file exists and the partial download file has gone.

Check content: read the file and assert on rows, not just that a file exists.

Sample spoken answer:

“Selenium drives the page, but the downloaded file is just a file on disk, so the test has to go and look for it. I set Chrome's preferences so downloads go to a fresh folder for each run and it doesn't ask where to save. After clicking Export, I poll that folder with a wait until a .csv file is there and the temporary .crdownload file has gone, because checking too early gives you a half-written file. Then I open it and check the header and the row count against the data the test created. On Grid it's different, because the file lands on the node machine, not where the test runs, so there we either use the Grid's download support or check the export through the API instead.”

Code:
Map<String, Object> prefs = new HashMap<>();
prefs.put("download.default_directory", downloadDir.toString());
prefs.put("download.prompt_for_download", false);
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("prefs", prefs);
WebDriver driver = new ChromeDriver(options);
Red flag to avoid:

A Thread.sleep after the click and then assuming the file is complete.

They may ask next:
  • How would you avoid two parallel tests picking up each other's downloaded file?
  • When would you skip the browser and test the export endpoint directly?
Say it in 60 seconds
Medium Coding round Mid-level Practice question

11. The products table sorts by price when you click the column header. How would you write a test that checks the sort really works?

What the interviewer is really testing:
Whether you compare values as numbers, wait for the sort to finish, and know the limits of checking one page.
Answer frame:

Trigger and wait: click the header and wait for a sign the sort is done.

Read values: collect the column, turn the text into numbers.

Compare: against a sorted copy of the same list.

Sample spoken answer:

“I click the Price header and then wait for something that says the sort finished, in our app the header's aria-sort attribute changes to ascending. Then I read every price cell, strip the currency symbol and separators, and parse them as numbers. Comparing the text would be wrong, because as strings 100 comes before 20. I make a copy, sort the copy, and assert both lists are equal. If they aren't, the assertion message shows both lists, which makes the failure easy to read. One limit I call out: this only checks the rows on the first page. If the table is paginated and sorted on the server, I also check the first row on page two isn't cheaper than the last row on page one, or I check the API response.”

Code:
By priceHeader = By.cssSelector("th[data-col='price']");
driver.findElement(priceHeader).click();
wait.until(ExpectedConditions.attributeToBe(priceHeader, "aria-sort", "ascending"));

List<Double> prices = driver.findElements(By.cssSelector("td.price")).stream()
    .map(td -> Double.parseDouble(td.getText().replaceAll("[^0-9.]", "")))
    .collect(Collectors.toList());
List<Double> sorted = new ArrayList<>(prices);
Collections.sort(sorted);
assertEquals(prices, sorted);
Red flag to avoid:

Comparing the cell text as strings, or reading the cells before the sort has finished.

They may ask next:
  • How would you test descending order and ties on the same price?
  • What would you change if the column held dates instead of prices?
Say it in 60 seconds
Hard Technical round Mid-level Practice question

12. The dashboard draws its sales chart on a canvas, so there are no elements for the bars. How did you check the chart shows the right data?

What the interviewer is really testing:
Whether you know Selenium can't see inside a canvas and pick a sensible mix: the data behind the chart, the parts that are real elements, and at most a careful visual check.
Answer frame:

The limit: a canvas is one element; the bars are pixels, not page elements.

Check the data: assert on the API response the chart is drawn from.

Check what is HTML: title, legend, totals and tooltips; a screenshot comparison only with a tolerance.

Sample spoken answer:

“I told the team up front that Selenium sees the canvas as a single element, so there's no locator for a bar. I split the check into three. The numbers themselves I test against the API that feeds the chart, since that's where a wrong value would come from. On the page I check what is real HTML: the chart title, the legend items, the date range and the total shown above the chart. And I check the canvas is displayed and has a real size, so an empty chart doesn't slip through. We tried a screenshot comparison of the chart area, but small rendering differences between machines made it noisy, so we kept that to one nightly check with a tolerance. For one chart we also asked the developers for a hidden data table for screen readers, which gave us something real to assert on.”

Red flag to avoid:

Saying charts can't be tested at all, or comparing full screenshots with zero tolerance.

They may ask next:
  • Would you read the chart's data through the charting library with JavaScript? What could go wrong?
  • How would you check the tooltip that appears when you hover over one bar?
Say it in 60 seconds
Medium Coding round Mid-level Practice question

13. An accessibility bug says the sign-up form can't be completed with the keyboard. How would you write a test that Tab moves through the fields in the right order?

What the interviewer is really testing:
Whether you know how to send keys to the focused element, read which element has focus, and make the failure easy to read.
Answer frame:

Start point: click into the first field.

Move and read: press Tab, then read the focused element with switchTo().activeElement().

Compare: the list of focused ids against the expected order, then submit with Enter.

Sample spoken answer:

“I click into the first field, then press Tab on the focused element and read which element now has focus with switchTo().activeElement(), recording its id each time. At the end I compare that list with the order the designer expects, so a failure shows exactly where focus jumped. I compare ids, or names where there's no id, rather than labels, since labels change with copy edits. I also finish by pressing Enter on the submit button to prove the whole form works without a mouse. This caught a real bug for us: a custom country dropdown that took focus but couldn't be opened from the keyboard. It doesn't replace a proper accessibility audit, but it's a cheap check that stops that bug coming back.”

Code:
List<String> expected = List.of("name", "email", "password", "country", "terms", "submit");
driver.findElement(By.id("name")).click();
List<String> actual = new ArrayList<>();
actual.add(driver.switchTo().activeElement().getDomAttribute("id"));
for (int i = 1; i < expected.size(); i++) {
    driver.switchTo().activeElement().sendKeys(Keys.TAB);
    actual.add(driver.switchTo().activeElement().getDomAttribute("id"));
}
assertEquals(actual, expected);
Red flag to avoid:

Checking only that each field can be clicked, which says nothing about keyboard users.

They may ask next:
  • How would you check that a modal keeps focus inside it while it is open?
  • Why can the Tab order differ between browsers or operating systems?
Say it in 60 seconds

Debugging Failures 3 questions

Medium Technical round Mid-level Practice question

14. Your tests pass locally, but in the CI Docker container Chrome crashes partway through with a tab crashed error, mostly on heavy pages. What did you find?

What the interviewer is really testing:
Whether you can trace a crash to the environment and know the common container cause: too little shared memory for Chrome.
Answer frame:

Read the pattern: only in the container, only on heavy pages, never the same test twice.

Cause: a Docker container gets a small /dev/shm by default, and Chrome uses shared memory heavily.

Fix: give the container more shared memory, or pass --disable-dev-shm-usage so Chrome uses /tmp instead.

Sample spoken answer:

“The pattern was the clue: it only happened in the CI container, on the pages with big tables and charts, and never in the same test twice. That pointed at the environment, not the code. Chrome uses shared memory a lot, and a Docker container only gets a small /dev/shm by default, so on heavy pages Chrome ran out and the tab crashed. We fixed it two ways. The container got a bigger shared memory size with the shm-size setting in the CI config, and as a safety net we added the --disable-dev-shm-usage argument to ChromeOptions for CI runs, which makes Chrome write those files to /tmp instead. The crashes stopped. I also added the container's memory use to the job log, so the next resource problem shows up sooner.”

Code:
ChromeOptions options = new ChromeOptions();
if (System.getenv("CI") != null) {
    options.addArguments("--headless=new", "--disable-dev-shm-usage");
}
WebDriver driver = new ChromeDriver(options);
Red flag to avoid:

Adding retries until the crashes stop showing, without looking at the environment.

They may ask next:
  • Why do people often add --no-sandbox in containers, and what is the risk of it?
  • How would you tell a memory problem on the agent from a real bug in the page?
Say it in 60 seconds
Hard Technical round Mid-level Practice question

15. In CI, a test clicks Add to cart with no error, but nothing happens and the next check fails. Locally it always works. How did you trace that?

What the interviewer is really testing:
Whether you know an element can be visible and enabled before the page's JavaScript is ready to handle the click, and wait for a real ready signal.
Answer frame:

Symptom: the click succeeded from Selenium's side, so there is no exception; the page ignored it.

Cause: on a fast agent the button is on screen before the script that handles it has loaded, for example on a server-rendered page.

Fix: wait for a signal that the app is ready, not for the button alone, and never a fixed sleep.

Sample spoken answer:

“No exception meant Selenium did click, so the question was why the page ignored it. The failure screenshot showed the button there and the cart empty. I added timestamps to the step log and saw the click happened a fraction of a second after the page loaded. Our shop page is rendered on the server, so the HTML, button included, shows up before the JavaScript that attaches the click handler has finished loading. Waiting for clickable only means visible and enabled, not wired up. On my laptop the timing just happened to work. The fix was to ask the developers for a small ready marker, an attribute the app sets on the body once it has started, and our page objects wait for it after every page load. That also cleared up three other flaky tests.”

Code:
driver.get(baseUrl + "/product/42");
wait.until(ExpectedConditions.attributeToBe(By.tagName("body"), "data-app-ready", "true"));
driver.findElement(By.cssSelector("[data-testid='add-to-cart']")).click();
Red flag to avoid:

Adding a Thread.sleep before the click, or switching to a JavaScript click that hides the problem.

They may ask next:
  • What would you do if the developers couldn't add a ready marker?
  • How could the same kind of problem show up on a screen that changes without a full page load?
Say it in 60 seconds
Medium Technical round Mid-level Practice question

16. About one run in ten fails with ElementClickInterceptedException, on a different test each time. You find a survey pop-up that shows on random visits. How did you deal with it?

What the interviewer is really testing:
Whether you control the app's state so the pop-up never shows in tests, instead of wrapping every click in try and catch.
Answer frame:

Find the rule: how the app decides to show it: a random share of visits, a cookie, a feature flag.

Control it: set the cookie or flag that marks it as seen, or switch it off for automation users.

Cover it once: one test that makes the pop-up show and checks it can be closed.

Sample spoken answer:

“The random pattern was the hint, because the failing test changed every time. The screenshots showed a survey box over the page, and the developers told me it appeared on a random share of visits unless a cookie said the user had already answered. We used two fixes. In the test environment the survey is now behind a feature flag that's off for our automation users, and for other environments our base test sets the survey-seen cookie right after opening the site. What I didn't want was a try and catch around every click that closes the pop-up if it's there, because that slows every step and can hide real overlap bugs. And there's one test with the flag on that checks the survey opens and can be closed.”

Red flag to avoid:

A helper that looks for the pop-up and closes it before every click.

They may ask next:
  • What would you do if the pop-up came from a third-party script you can't configure?
  • How would you make sure this fix does not hide a real overlay bug?
Say it in 60 seconds

Framework Code 2 questions

Medium Coding round Mid-level Practice question

17. The team wants the same suite to run on Chrome, Firefox or Edge, chosen when the job starts. How did you wire that up in your code?

What the interviewer is really testing:
Whether you keep browser choice in one factory driven by configuration, not scattered through tests.
Answer frame:

Input: a system property or TestNG parameter, with a default.

One factory: a single method turns the name into a configured driver.

Tests stay clean: they never create a driver themselves.

Sample spoken answer:

“I added one small driver factory. It reads the browser name from a system property, so CI can pass something like -Dbrowser=firefox, and falls back to Chrome when nothing is passed. A switch statement builds the right driver with its options: window size, headless when the job asks for it, download folder and so on. The base test calls the factory in setup, and no test ever says new ChromeDriver. When we later moved to Grid, only the factory changed, to build a RemoteWebDriver with the same options. The first Firefox run found a few failures that weren't browser bugs at all, just tests that relied on Chrome's timing, so it was worth having.”

Code:
public static WebDriver create() {
    String browser = System.getProperty("browser", "chrome").toLowerCase();
    switch (browser) {
        case "firefox":
            return new FirefoxDriver(new FirefoxOptions());
        case "edge":
            return new EdgeDriver(new EdgeOptions());
        default:
            return new ChromeDriver(new ChromeOptions());
    }
}
Red flag to avoid:

Copying the whole suite per browser, or creating drivers inside individual tests.

They may ask next:
  • What would change in this factory when tests run on Selenium Grid?
  • A test fails only on Firefox. How do you decide whether it is the app or the test?
Say it in 60 seconds
Medium Coding round Mid-level Practice question

18. The same data grid, with paging and row actions, appears on eight pages. How did you avoid writing its locators in eight page objects?

What the interviewer is really testing:
Whether you can build a small component object that searches inside its own root element and is reused by page objects.
Answer frame:

Component object: one class for the grid, built from the grid's root element.

Search inside the root: relative locators, so two grids on one page do not clash.

Pages compose it: each page object hands back its grid instead of copying code.

Sample spoken answer:

“I pulled the grid into its own class, a component object. It takes the grid's root element, and every lookup inside it is relative to that root, so the row and pager locators are written once. It has methods like rowCount and clickAction for the row that holds a given value. Each page object just returns a DataGrid built from its own container, so the orders page and the users page share the same code. The gotcha that bit me was XPath: inside the root it has to start with a dot, otherwise a double slash searches the whole page and finds the wrong grid's row. When the frontend team changed the grid's markup, I fixed one class instead of eight. And the page object builds a fresh grid each time it's asked, so a reloaded grid never leaves me holding a stale root.”

Code:
public class DataGrid {
    private final WebElement root;

    public DataGrid(WebElement root) {
        this.root = root;
    }

    public int rowCount() {
        return root.findElements(By.cssSelector("tbody tr")).size();
    }

    public void clickAction(String rowText, String action) {
        root.findElement(By.xpath(".//tbody/tr[td[normalize-space()='" + rowText + "']]"
            + "//button[normalize-space()='" + action + "']")).click();
    }
}
// ordersPage.grid().clickAction("ORD-1042", "Refund");
Red flag to avoid:

Copying the grid locators into every page object, or writing XPaths inside the root that start with a double slash.

They may ask next:
  • How would you add sorting by a column name to this class?
  • Would you put assertions inside the component? Why or why not?
Say it in 60 seconds

Owning Automation 4 questions

Medium Behavioral round Mid-level Practice question

19. How do you check your own new automated test before you raise it for review? How do you know it would actually fail if the feature broke?

What the interviewer is really testing:
Whether you test your tests: seeing them fail for the right reason, running them repeatedly and in the same way CI will.
Answer frame:

See it fail: break the expected value or point it at a known bad state and check it goes red with a clear message.

See it hold: run it several times, and in parallel with its neighbours.

Run it like CI: headless, on the same browser and settings the pipeline uses.

Sample spoken answer:

“The first thing I do is make it fail on purpose. I change the expected text or the amount it checks, and I make sure it goes red and the message says what went wrong. Once, a test of mine stayed green even with a wrong expected value, and it turned out the assertion was inside a branch that never ran. After that I run it maybe ten times in a row, and together with the other tests in its class in parallel, because that's where timing and shared data problems show. Finally I run it headless with the same browser settings CI uses before I open the pull request. It takes an extra half hour, but it saves the team from a test that's either useless or flaky.”

Red flag to avoid:

Saying it passed once locally, so it's ready.

They may ask next:
  • Have you ever found a test in your suite that could never fail? How did you spot it?
  • What do you include in the pull request so the reviewer trusts the test?
Say it in 60 seconds
Easy Behavioral round Mid-level Practice question

20. Tell me about code review feedback on your Selenium code that changed how you write tests.

What the interviewer is really testing:
Whether you take feedback well and can name a concrete habit that changed because of it.
Answer frame:

The code: what you wrote and why it seemed fine.

The feedback: what the reviewer pointed out.

The habit now: what you do differently every time.

Sample spoken answer:

“Early in my second year I raised a pull request with a new page object for the checkout page. It had a Thread.sleep of three seconds after the pay button, and a couple of methods that did assertions inside the page object. My senior asked two things: what exactly was I waiting for, and how would another test reuse this page if it wanted to check a failed payment. That made me see the sleep was hiding a real condition, the confirmation panel appearing, so I replaced it with an explicit wait on that. And I moved the assertions into the tests, so the page object only returns what's on the page. Now before I raise anything I search my change for sleep, and I ask whether a different test could use my page methods as they are.”

Red flag to avoid:

Saying you have never had useful review feedback, or describing it defensively.

They may ask next:
  • What do you look for now when you review someone else's Selenium code?
  • Have you ever disagreed with review feedback? What happened?
Say it in 60 seconds
Medium Behavioral round Mid-level Practice question

21. Automating a flow took you far longer than you told your lead. What was hidden in it, and what do you plan for now when sizing Selenium work?

What the interviewer is really testing:
Whether you can own a miss honestly and show the specific hidden work you now plan for in UI automation.
Answer frame:

The task and the guess: what you estimated and what it really took.

What you missed: test data, environment, tricky widgets, making it stable in CI.

Now: a short spike first and a split between writing and stabilising.

Sample spoken answer:

“I estimated two days to automate the new refund flow, because it was only four screens. It took more than a week. Writing the steps was the quick part. What I missed was that refunds needed an order that had already been paid and shipped, and there was no easy way to create one, so I had to work with a developer on a test-data endpoint. The payment screen was an iframe from a third party that behaved differently in the test environment, and once it ran in CI it was flaky for two days until I found a timing issue. I told my lead as soon as I saw it slipping. Now I spend an hour on a spike first, list what data and setup the flow needs, and estimate getting it stable in CI as its own piece.”

Red flag to avoid:

Blaming the environment or developers entirely, with nothing you would do differently.

They may ask next:
  • When did you tell your lead, and what did you say?
  • How do you estimate a flow you have never seen before?
Say it in 60 seconds
Medium Behavioral round Mid-level Practice question

22. Walk me through a feature you automated end to end, from the story being ready to the tests running in CI.

What the interviewer is really testing:
Whether you own the whole path: choosing what to automate, working with developers, writing, reviewing and watching the first runs.
Answer frame:

Before code: read the acceptance criteria and pick which checks belong in the UI.

While building: agree test ids and data setup with the developer.

After merge: add to the right suite, watch the first CI runs, fix what shows up.

Sample spoken answer:

“The one I'd pick is saved addresses in our checkout. When the story was ready I went through the acceptance criteria and split them: validation rules I left to the developer's API tests, and in Selenium I covered add, edit, delete and choosing a saved address at checkout. I asked the developer early to add data-testid attributes on the address cards, since the classes were generated, and to expose an API call to create addresses for setup. I wrote the page object and four tests while the feature was being built, so they were ready when it hit the test environment. I tagged two of them as smoke. After merge I watched the pipeline for a week, and one test failed once when two addresses had the same name, which led to a small real bug.”

Red flag to avoid:

A story that starts and ends with writing the script, with no thought for what to cover or how it runs in CI.

They may ask next:
  • How did you decide which checks stayed out of the UI tests?
  • What would you have done if the developer couldn't add test ids in time?
Say it in 60 seconds
Were you asked something else? Share it A person checks every question before it goes on the site. No name is shown.
For the call itself

You practiced these. On the real call, ClapAssist helps with the rest.

ClapAssist is an AI interview assistant for Mac and Windows. It listens to the interview on your computer and shows you what to say, in short lines you can read while you talk. Your live interview audio and screen are never stored. Your resume and notes are saved to your account so the app fills them in on any computer. It stays out of screen share on every plan, including Free; only you can see it.

Download with 10 free minutes
Mac and Windows · Stays out of screen share · No card