HDFC Bank Automation Testing Interview Questions & Answers
Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.
About HDFC Bank hiring for Automation Testing roles
HDFC Bank is one of India's largest private sector banks, offering retail banking, loans, cards, wholesale banking and digital banking. Its analytics, risk and technology teams work on credit decisions, customer analytics, fraud detection and digital channels. It hires for data analysts, credit and risk analysts, testers and technology roles.
For Automation Testing roles, this HDFC Bank practice set focuses most on Selenium WebDriver (8), TestNG Framework (8), REST Assured (4), Page Object Model (4). It has 3 easy, 32 medium, 5 hard questions, so you can start easy and work up to the harder ones.
Company type
Banking & finance
Headquarters
Mumbai, India
Main India offices
Mumbai, Chennai, Bengaluru
HDFC Bank Automation Testing interview process
Online assessment (aptitude + domain)
Technical or functional interview
Managerial round
HR round
Typical pattern based on public candidate experiences. Rounds vary by role, team and year.
Solved for HDFC BankStart 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.
✓ 3 questions free • Unlock the rest in seconds
01
Write Java code to start an Android Appium session using UiAutomator2Options.
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.
Use multipart: given().multiPart("file", new File("src/test/resources/report.pdf"), "application/pdf").formParam("type", "invoice").when().post("/upload").then().statusCode(200). REST Assured sets the multipart/form-data content type automatically. Verify both the status and the response, such as the returned file id or size, and test edge cases like empty, oversized and wrong-type files.
04
How do you test an API that depends on another service that is down?
Situation: a new product had no automation and a three-month release target. Task: I was asked to set up the framework and guide two juniors. Action: I chose Java, TestNG, Selenium with POM and REST Assured, set up Maven, Jenkins and Allure, wrote conventions and reviewed every pull request early on. Result: we had 250 stable tests in CI before release, and the juniors could extend it independently.
08
Tests run fine on Chrome but fail on Firefox at the same step. How do you investigate?
Rerun on Firefox with screenshots and logs. Common causes are timing differences, different default window sizes, unsupported CSS or JavaScript behaviour, alerts handled differently, or a driver version mismatch. Compare the DOM in both browsers at that step. Fix by using explicit waits, setting window size, and reporting genuine browser bugs to developers.
09
Write a step definition that reads a DataTable as a list of maps.
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.
Docker Compose runs a fixed number of nodes on one machine, which is simple but limited to that host's CPU and memory. On Kubernetes, typically installed with the Selenium Helm chart, nodes are pods spread across a cluster, and KEDA can scale node pods up based on the queue length and back to zero when idle. It suits large teams with bursty CI demand but needs cluster knowledge and monitoring.
Inside a container, localhost means the container itself, not the host machine. On Docker Desktop use host.docker.internal as the host name. On Linux add extra_hosts with host.docker.internal:host-gateway, or use the host's IP. A cleaner option is running the application in the same Compose network and calling it by its service name, such as http://web:8080. Make sure the app listens on 0.0.0.0, not only 127.0.0.1.
Appium 2 split the monolithic server into a core plus separately installed drivers and plugins, managed with appium driver install and appium plugin install. It dropped the old JSON Wire Protocol in favour of W3C WebDriver only, so vendor capabilities need the appium: prefix. The default base path changed from /wd/hub to /. Old TouchAction and MultiTouchAction were removed from the Java client, so gestures use W3C Actions or mobile: commands.
17
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.
18
Your API tests started failing with SSL handshake errors on a new test server. What do you do?
First confirm the server uses a self-signed or internal certificate. The proper fix is to import the company CA certificate into a truststore and configure REST Assured with trustStore(path, password). As a temporary measure in a test environment only, relaxedHTTPSValidation() skips checks. Never use relaxed validation against production, and raise the certificate issue with the infra team.
19
What is dryRun in Cucumber and when do you use it?
dryRun=true makes Cucumber parse all feature files and check every step has a matching definition without actually executing anything. It is fast and is useful after writing new features, during refactoring, or as a quick CI gate to catch undefined or ambiguous steps. It also prints snippets for missing step definitions that you can paste and implement.
20
What is the difference between Comparable and Comparator in Java?
Comparable defines the natural order inside the class (compareTo); Comparator defines custom orders externally (compare), useful for sorting test data in several ways.
21
Parallel TestNG runs open browsers that interact with each other's tests. How do you fix it?
The WebDriver is shared, probably through a static field. Replace it with a ThreadLocal<WebDriver> in a DriverManager, create the driver in @BeforeMethod and call quit() and remove() in @AfterMethod(alwaysRun = true). Make page objects take the driver from the current thread. Also check test data, reports and loggers are thread-safe.
22
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.
LoadableComponent is a Selenium support class that standardises how a page object ensures it is loaded. You extend it and implement load(), which navigates to the page, and isLoaded(), which throws an Error if the page is not ready. Calling get() checks isLoaded and calls load only if needed, then checks again. It gives a consistent, self-verifying way to open pages and fails fast with a clear message.
Declarative pipelines use a fixed structure: pipeline, agent, stages, steps, post, with built-in options and validation; they are easier to read and are the recommended default. Scripted pipelines use node blocks and full Groovy, giving more flexibility for complex logic but making them harder to maintain. Most test pipelines use declarative syntax with small script blocks only where needed.
Do not load everything as one giant DataProvider; that creates thousands of UI tests. First question whether all rows need UI runs; most can be validated at API level. Read the file with BufferedReader or Files.lines() as a stream, filter to the rows you need, and use a lazy Iterator<Object[]> DataProvider so rows load as tests run, keeping memory low.
31
Tests pass on QA but fail in the staging pipeline. How do you investigate?
Compare what differs: configuration URLs, test data, feature flags, user permissions, network or proxy, browser versions and timing due to slower servers. Check logs and screenshots from staging and rerun one failing test with verbose logging. Often the issue is missing data or a flag. Fix by making environment settings explicit and creating required data in test setup.
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.
33
A file download test passes locally but fails in a Grid node. How do you approach it?
The file is saved on the remote node, not the machine running the test, so the test cannot find it locally. Options are enabling Selenium Grid's managed downloads with se:downloadsEnabled and fetching the file through the Grid API, sharing a mounted volume with the container, or verifying the download by requesting the file URL with an HTTP client and checking status, size and type.
34
What is the difference between getText() and getAttribute()?
Make the outcome explicit with separate methods instead of one method guessing. For example loginAs(user) returns DashboardPage for valid credentials, while loginExpectingError(user) returns the same LoginPage so the test can check the error. Each method waits for its expected page and fails clearly if it does not appear. This keeps tests readable and avoids returning a generic Object or checking types in tests.
git fetch downloads new commits and branches from the remote but does not change your working files; you can inspect them with git log origin/main. git pull is fetch followed by merge (or rebase if configured) into your current branch. Fetch is safer when you want to review changes before integrating them.
methods runs each @Test method in its own thread, giving the most parallelism but requiring fully independent tests and thread-safe drivers. classes runs all methods of one class in the same thread, with different classes in parallel. tests runs each <test> tag in parallel, often used to run different browsers. instances is also available for factory instances. thread-count sets the pool size.
Tips to crack the HDFC Bank Automation Testing interview
Learn Indian banking basics like CASA, NPAs, credit scores, KYC and RBI regulations for domain questions.
Revise SQL, Excel and basic statistics for analytics and risk roles with banking examples.
Understand UPI, net banking and mobile banking flows if applying for digital channel testing roles.
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; HDFC Bank interviewers usually ask follow-ups on your first answer.
Frequently asked questions
How many rounds are there in the HDFC Bank Automation Testing interview?
Candidates usually go through 4 stages: Online assessment (aptitude + domain); Technical or functional interview; Managerial 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 HDFC Bank Automation Testing interview?
This practice set leans on Selenium WebDriver (8), TestNG Framework (8), REST Assured (4), Page Object Model (4). Revise those first, then practise explaining one or two of your own projects end to end, because most HDFC Bank interviewers ask you to walk through real work.
Are these the exact questions asked at HDFC Bank?
No. These are curated practice questions that match the skills and difficulty usually tested in banking & finance interviews like HDFC Bank's. They are not a leaked or verified list of past questions.
Where does HDFC Bank hire Automation Testing professionals in India?
HDFC Bank has large teams in Mumbai, Chennai, Bengaluru. Openings and locations change often, so check the HDFC Bank careers page and filter by city and experience.
Automation Testing questions for similar companies