Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.
About UBS hiring for Automation Testing roles
UBS is a Swiss global financial services firm known for wealth management, investment banking, asset management and Swiss retail banking. It acquired Credit Suisse in 2023. In India it runs large business solutions and technology centres that hire software engineers, data analysts, risk and finance professionals, and operations roles supporting its global businesses.
For Automation Testing roles, this UBS practice set focuses most on Selenium WebDriver (7), Core Java for Testers (6), Git, Maven and Jenkins (5), API Testing and CI/CD (5). It has 6 easy, 33 medium, 1 hard questions, so you can start easy and work up to the harder ones.
Company type
Banking & finance
Headquarters
Zurich, Switzerland
Main India offices
Pune, Mumbai, Hyderabad
UBS Automation Testing interview process
Online assessment (aptitude + coding)
Technical interview
Managerial or business round
HR round
Typical pattern based on public candidate experiences. Rounds vary by role, team and year.
Solved for UBSStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
The driver was never initialised or was passed as null, for example a page created before setup ran or a static driver not yet assigned. With PageFactory, initElements may not have been called, so @FindBy fields are null. A config value read from a properties file may also be missing. Check the stack trace line, then fix the setup order and add null checks with clear messages.
04
A test fails with TimeoutException waiting for an element that is clearly visible on screen. What do you check?
Check whether the element is inside an iframe or shadow DOM, the locator matches a different hidden element first, the page opened in a new tab not yet switched to, or the wait condition is wrong, such as presence versus visibility versus clickable. Use findElements to see how many matches the locator has and verify it in browser DevTools.
05
How do you record videos of tests running on a Docker Selenium Grid?
Add the selenium/video image as a sidecar container next to each node, sharing the node's display through DISPLAY_CONTAINER_NAME, and mount a folder for the mp4 files. Newer Grid versions also support recording per session by setting the se:recordVideo capability with Dynamic Grid. Name videos with se:name so they match test names. Keep videos only for failed tests or for a few days, because they use a lot of disk space.
A quality gate is a rule a build must pass before moving forward, such as all smoke tests passing, code coverage above a threshold, no critical static analysis issues, or no new high-severity vulnerabilities. If the gate fails, the pipeline stops and the change is not deployed. Gates make quality an automatic decision instead of a manual check.
07
What are the advantages of version control for test code?
BasePage is a parent class for all page objects holding common things: the driver reference, a WebDriverWait, and helper methods such as click with wait, type, getText, waitForVisible and scrollIntoView. Child pages extend it and stay focused on page-specific locators and actions. Keep it small; if it grows into hundreds of methods, move helpers into separate utility classes using composition.
09
How do you handle an element inside a shadow DOM in Selenium 4?
Find the shadow host element, then call getShadowRoot() to get a SearchContext, and search inside it with CSS selectors: driver.findElement(By.cssSelector("my-app")).getShadowRoot().findElement(By.cssSelector("#submit")). XPath does not work inside shadow roots. For nested shadow roots, repeat the step for each host. Closed shadow roots cannot be accessed this way.
Continuous Integration builds and tests every commit, and Continuous Delivery ships automatically. Automated tests give fast feedback and gate releases.
11
Tell me about a time you worked with a team in a different location or time zone on automation.
Situation: our developers were in another time zone and test failures waited a day for replies. Task: reduce delays. Action: I wrote clear failure reports with screenshots, logs and steps, recorded short videos for complex issues, and set a fixed 30-minute overlap call twice a week. Result: turnaround on defects dropped from two days to about one, and fewer issues bounced back.
12
How do you get reports, screenshots and downloaded files out of a Docker container?
Use volumes. A bind mount maps a host folder into the container, for example -v $(pwd)/target:/app/target, so reports written in the container appear on the CI agent for archiving. Named volumes are managed by Docker and suit data that should survive restarts. For browser downloads, mount the node's download folder or enable the Grid's managed downloads with the se:downloadsEnabled capability to fetch files through the Grid API.
13
A teammate compares two strings with == and the test sometimes passes and sometimes fails. Explain.
== compares object references, not content. String literals are interned, so two literals with the same text may share a reference and == returns true, but strings read from the UI or built at runtime are new objects, so == returns false even with the same text. Use equals() or equalsIgnoreCase() for content, and Objects.equals() to be null-safe.
14
Write Selenium code to wait for a loader to disappear and then click a button.
Write a utility that reads the sheet with Apache POI and returns Object[][] with one row per test case. Create a @DataProvider method that calls the utility, and set dataProvider = "loginData" on the test. Each row runs as a separate test with its own result. Keep the file in src/test/resources and consider CSV or JSON, which are easier to review in Git.
18
What is the difference between static and non-static members?
Use collection matchers inside body(). For example body("data.id", hasItems(1, 2)), body("data", hasSize(6)), body("data.email", everyItem(containsString("@"))) and body("data.find { it.id == 3 }.name", equalTo("Neha")). These check the whole collection in one line. For complex rules, extract a List with jsonPath().getList() and assert with Java or AssertJ.
20
Tell me about a time a BDD conversation clarified a requirement before development started.
Situation: a story said users get a refund if an order is cancelled early. Task: write scenarios with the product owner and developer. Action: while writing examples I asked what early meant and whether shipped orders counted. The three of us found the story had no time limit and no rule for partial shipments, and we wrote four concrete scenarios. Result: the rules were fixed before coding, avoiding a rework that had happened in a previous sprint.
21
Write Java code to create a RemoteWebDriver for a Selenium Grid using ChromeOptions.
Check that endpoints reject missing or invalid tokens with 401, block users from other users' data with 403 or 404, validate input to prevent injection, do not leak stack traces or sensitive fields, enforce HTTPS and set security headers. Automate these as negative tests in the regression suite and work with the security team for deeper penetration testing.
23
What are stubs, mocks, fakes and spies in testing?
They are test doubles that replace real dependencies. A stub returns fixed answers, such as a fake API returning a canned user. A mock also verifies how it was called, like checking a payment service received one charge. A fake is a lightweight working version, such as an in-memory database. A spy wraps a real object and records calls. Automation testers often use WireMock stubs to isolate tests from unstable services.
24
Your Selenium tests in CI produce blank screenshots in headless mode. What could be wrong?
The screenshot may be taken before the page renders, the window size in headless mode may be tiny, or the browser is crashing due to low shared memory in Docker. Set --window-size=1920,1080, use the new headless mode, wait for page content before capturing, and add --disable-dev-shm-usage or a larger shm size for containers.
Create a ModalComponent class scoped to the modal root element, with methods like title(), confirm() and cancel(). Pages that open modals return the component, such as cartPage.removeItem() returning ConfirmModal. The component waits for itself to appear and disappear. This keeps modal logic in one place and avoids copying locators into every page.
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.
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.
30
Describe a time you convinced developers to fix a problem found by automation.
Situation: an API test kept failing intermittently and developers called it a test issue. Task: prove or disprove it. Action: I collected logs from ten failures, showed the same race condition in the order service with request IDs, and reproduced it with a small parallel script. Result: developers fixed a real concurrency bug before it reached customers, and trust in the suite improved.
Send invalid or missing fields, wrong data types, values beyond limits, invalid IDs, expired or missing tokens, wrong HTTP methods and malformed JSON. Assert the correct status (400, 401, 403, 404, 405, 422) and a clear error body without stack traces. Negative tests often find more defects than happy paths because validation and security checks are frequently incomplete.
33
How do you publish Allure or Extent reports from Jenkins?
For Allure, install the Allure Jenkins plugin, configure the commandline tool, and add allure results: [[path: 'target/allure-results']] in the post always block. For Extent, archive the HTML file and use the HTML Publisher plugin to show it as a build link. Keep report history per build and share the link in failure notifications.
34
How do you switch between native and webview contexts in a hybrid app?
// Requires the webview to be debuggable in the app build
Set<String> contexts = driver.getContextHandles();
for (String ctx : contexts) {
if (ctx.startsWith("WEBVIEW")) {
driver.context(ctx);
break;
}
}
driver.findElement(By.cssSelector("#email")).sendKeys("qa@test.com");
// back to native controls
driver.context("NATIVE_APP");
35
How do you pass the WebDriver to page objects in a parallel framework?
Use a DriverManager with a ThreadLocal<WebDriver>, created in @BeforeMethod and removed in @AfterMethod. Page objects receive the driver through the constructor or get it from DriverManager.getDriver(). Constructor injection is cleaner and easier to test. Never store the driver in a static field shared by all threads, or parallel tests will control each other's browsers.
36
Your Jenkins test stage marks the build green even though tests failed. Why?
Possibly testFailureIgnore is set to true in Surefire, the shell step uses || true, or the script swallows Maven's exit code. Sometimes tests catch exceptions and never fail. Check the console log for Maven's BUILD result and Surefire summary. Fix the configuration so failures produce a non-zero exit, or use junit publishing to mark the build unstable when tests fail.
37
Tell me about a time a flaky test cost your team time and how you fixed it permanently.
Situation: a checkout test failed about one run in five and the team started ignoring red builds. Task: fix the root cause, not just rerun it. Action: I added logs and screenshots, found it raced with an async price recalculation, replaced a fixed sleep with a wait on the updated total and asked developers for a loading flag. Result: zero failures in the next sixty runs, and the team trusted red builds again.
Put explicit waits in page methods or BasePage helpers, not in tests. For example click() waits for elementToBeClickable before clicking, and a page's isLoaded() waits for a key element. Avoid Thread.sleep and avoid mixing implicit and explicit waits. Keep the timeout configurable so CI can use a slightly longer value than local runs.
39
An element is visible in Appium Inspector but your test throws NoSuchElementException on the device. What do you check?
First check timing: the screen may still be loading, so add an explicit wait for presence. Then check context: in a hybrid app the element may be in a webview while you are in NATIVE_APP. Confirm the locator matches exactly, including package prefix in resource-id. The element may be off screen in a list, so scroll first. Also check that the Inspector session used the same app build, language and device size as the test.
Absolute starts from the root (/html/...) and breaks easily; relative starts anywhere with // and is more stable, for example //input[@id='email'].
Tips to crack the UBS Automation Testing interview
Revise DSA, Java or Python, SQL and OOP concepts, and be ready to explain your code clearly in interviews.
Learn basics of wealth management, investment banking and financial markets to show interest in the business side.
Prepare examples of attention to detail and handling pressure, since banking technology roles demand reliability and accuracy.
Keep a one-minute story ready for every project on your CV: problem, your part, tools, result.
Practise the hard questions on this page aloud; UBS interviewers usually ask follow-ups on your first answer.
Frequently asked questions
How many rounds are there in the UBS Automation Testing interview?
Candidates usually go through 4 stages: Online assessment (aptitude + coding); Technical interview; Managerial or business round; HR round. The exact rounds change with the role, team, location and your experience, so confirm the process with the recruiter.
Which topics should I prepare for the UBS Automation Testing interview?
This practice set leans on Selenium WebDriver (7), Core Java for Testers (6), Git, Maven and Jenkins (5), API Testing and CI/CD (5). Revise those first, then practise explaining one or two of your own projects end to end, because most UBS interviewers ask you to walk through real work.
Are these the exact questions asked at UBS?
No. These are curated practice questions that match the skills and difficulty usually tested in banking & finance interviews like UBS's. They are not a leaked or verified list of past questions.
Where does UBS hire Automation Testing professionals in India?
UBS has large teams in Pune, Mumbai, Hyderabad. Openings and locations change often, so check the UBS careers page and filter by city and experience.
Automation Testing questions for similar companies