Prepare for SCB interviews with 33 curated questions. The answer examples below explain key concepts; personalize project and experience responses truthfully. These are independent study resources, not official company interview materials.
Interview Questions with Answer Explanations
These study answers summarize the associated PDF material. Adapt personal, project and experience details to your own background.
Eclipse IDE and Selenium interaction — architecture
Eclipse is the IDE in which you write, compile, debug, and run Java test code. Selenium is the browser-automation library. When a test calls WebDriver methods, the Java binding sends commands through Selenium's driver communication layer to a browser-specific driver or browser automation endpoint. The browser executes the command and returns a response, which WebDriver exposes to the Java code.
System.setProperty("webdriver.ie.driver", "path of ie driver.exe")
System.setProperty sets a Java system property. In older Selenium setups, the property webdriver.ie.driver specified the filesystem path to IEDriverServer.exe, the executable Selenium used to communicate with Internet Explorer. The path must point to the actual driver executable, not to a webpage or application file. The exact property and driver setup depend on the Selenium version.
Does using an .exe mean Selenium interacts with desktop applications?
No. The .exe in the example is IEDriverServer.exe, a helper process that exposes WebDriver commands for the Internet Explorer browser. Selenium WebDriver primarily automates web browsers and web content. It is not a general-purpose desktop UI automation tool for native Windows applications.
Why do we need browser drivers?
A driver bridges WebDriver commands from the test code to a specific browser. It translates standard commands such as navigate, click, send keys, and find element into browser-specific operations, then returns results and errors. Historically, a compatible driver executable had to be downloaded and configured. Modern Selenium Manager can automatically manage drivers for supported browsers, reducing manual setup.
Java code to read a file
Java offers several ways to read files. For small text files, Files.readString is concise (Java 11+). For line-by-line processing, use Files.readAllLines or a BufferedReader. Use try-with-resources for resources that must be closed.
Implicit wait and explicit wait — syntax and details
Implicit wait is a global WebDriver setting for element location. If an element is not immediately found, WebDriver keeps trying until the timeout, then throws NoSuchElementException. Explicit wait targets a particular condition, such as visibility, clickability, or a URL change. It is generally preferred for dynamic pages because it states exactly what must happen.
How to upload a file in Selenium
For a standard HTML file input, send the absolute file path to the input element using sendKeys. Usually, do not click the OS file chooser because WebDriver cannot reliably control native dialogs through ordinary DOM locators. If the input is hidden or the page uses a custom upload widget, inspect the DOM and interact with the underlying input where possible. Path file = Path.of("C:", "TestData", "sample.xlsx").toAbsolutePath();.
JavaScriptExecutor
JavascriptExecutor is a Selenium interface that executes JavaScript in the context of the current page. It can scroll, read DOM properties, or perform actions when standard WebDriver interactions are unsuitable. Prefer normal WebDriver methods first: JavaScript clicks can bypass normal user-interaction checks and may hide real UI problems. It cannot directly automate arbitrary desktop applications.
What is POM?
POM means Page Object Model, a design pattern that separates page locators and page actions from test assertions and scenarios. Each page or component is represented by a class. This improves maintainability: if a locator changes, it can often be updated in one place. Keep page methods meaningful, avoid putting all test logic into page classes, and avoid unnecessary duplication.
Have you worked on Cucumber?
A truthful interview answer should reflect your actual experience. If you have used Cucumber, explain that it supports Behavior-Driven Development through Gherkin scenarios and connects steps to automation code. A typical framework contains feature files, step definitions, hooks, runner/configuration, page objects, test data, and reporting. Explain one scenario you automated and how you manage setup, teardown, and reusable steps.
Click an element without trying every locator
First inspect the DOM and choose the most stable, unique locator. Prefer a unique id or a meaningful data-testid when available, then accessible role/name or a stable CSS selector. Use XPath when relationships or text-based DOM traversal are genuinely needed. Verify uniqueness and wait for the element to be actionable.
Can main() return type be int?
For a standard Java application entry point, main is declared with a void return type, for example public static void main(String[] args). A method named main can be overloaded or declared with another return type, but it will not serve as the conventional Java launcher entry point. The launcher does not use an int return value from main as the process exit code; use System.exit(status) when appropriate.
Frame handling code in Selenium
An iframe has its own browsing context. Selenium must switch into that frame before locating elements inside it, and switch back to the main document or parent frame afterward. Frames can be selected by index, name/id, or WebElement; a stable frame locator is generally preferable to an index.
Launch Internet Explorer browser
Legacy Selenium code used InternetExplorerDriver with IEDriverServer.exe and Internet Explorer-specific configuration. However, Internet Explorer 11 desktop application has been retired and is not supported by current mainstream Selenium/browser setups. For new automation, use Edge or Chrome. If a legacy application requires IE behavior, investigate Microsoft Edge IE mode and your organization's supported test strategy.
SQL: pull employee IDs from two tables where IDs match
Use an INNER JOIN when you want only employee IDs present in both tables. If duplicate IDs exist, the result can contain duplicates; use DISTINCT if the requirement is a unique list. SELECT a.emp_id FROM employees_a AS a INNER JOIN employees_b AS b ON a.emp_id = b.emp_id;.
What is a JOIN?
A JOIN combines rows from two or more tables using a related column or join condition. INNER JOIN returns matching rows; LEFT JOIN returns all rows from the left table and matching rows from the right; RIGHT JOIN does the reverse; FULL OUTER JOIN returns matched and unmatched rows from both sides where supported. CROSS JOIN returns combinations of every row from each table. -- All employees, including those without a matching department SELECT e.emp_id, e.emp_name, d.department_name FROM employee e LEFT JOIN department d ON e.department_id = d.department_id;.
Read a CSV file (flat-file reading)
A CSV is a text file with fields separated by commas, but values may contain quoted commas, escaped quotes, or newlines. For a simple controlled file, Java can read lines and split them; for real CSV data, prefer a CSV library such as Apache Commons CSV or OpenCSV because split(",") does not correctly handle all CSV rules.
What is XPath?
XPath is a language for selecting nodes in an XML/HTML document. Selenium uses XPath expressions to locate web elements. Absolute XPath starts from the document root and is usually brittle; relative XPath is more maintainable. XPath supports attributes, text, axes, and functions.
XPath sibling and following axes
The sibling axes select nodes with the same parent: following-sibling selects siblings after the current node, while preceding-sibling selects siblings before it. The following axis selects nodes that appear later in document order, excluding descendants; it is broader than following-sibling.
final keyword on variables and methods
A final variable can be assigned only once. A final reference cannot be reassigned, although the referenced object may still be mutable. A final method cannot be overridden in a subclass. A final class cannot be extended. final is different from finally, which is part of exception handling, and finalize(), which is a legacy lifecycle method. final int maxRetries = 3;.
static keyword
static members belong to the class rather than to each object instance. A static method can be called using the class name and cannot directly access instance members without an object reference. Static fields are shared across instances. Use static for class-level utilities or constants, but avoid mutable global state where possible.
Method overriding
Overriding occurs when a subclass provides a new implementation of an inherited instance method with the same signature and a compatible return type. It supports runtime polymorphism. Static methods are hidden rather than overridden; private methods are not inherited for overriding; final methods cannot be overridden.
Scroll down the page
Prefer scrolling through normal user interaction when possible. JavaScriptExecutor can scroll the window or a specific container. If an element is the target, scroll it into view and then wait for it to be actionable. JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("window.scrollTo(0, document.body.scrollHeight);");.
BDD and Cucumber framework
Behavior-Driven Development encourages collaboration among business, QA, and development by describing expected behavior in a shared language. Cucumber executes Gherkin feature files by matching Given/When/Then steps to step definitions. BDD is a practice; Cucumber is one tool that can support it. Avoid writing scenarios as mere implementation checklists; describe business behavior and observable outcomes.
What is Bitbucket?
Bitbucket is a Git-based source-code hosting and collaboration platform from Atlassian. Teams use repositories, branches, pull requests, code review, access controls, and integrations with tools such as Jira and CI/CD systems. It serves a similar source-control hosting purpose to GitHub, although product features and integrations differ. git clone https://bitbucket.org/workspace/repository.git git checkout -b feature/login-test git add . git commit -m "Add login test" git push -u origin feature/login-test.
CSS selector vs XPath
CSS selectors are concise and widely used for IDs, classes, attributes, and descendant relationships. XPath can navigate in both directions through the DOM, select by text, and use axes such as following-sibling. Neither is always faster in every browser; choose based on clarity, stability, and the DOM. Avoid brittle absolute paths and selectors tied to generated class names.
Extract only numbers from a string in Java
Use a regular expression to remove all characters that are not digits. If negative signs, decimals, or a particular locale matter, define the requirement first because the simple expression below retains digits only.
Difference between Selenium 3 and Selenium 2 / older versions
The question wording is ambiguous, so clarify which older version the interviewer means. Common Selenium 3 changes included moving toward the W3C WebDriver standard while retaining legacy JSON Wire Protocol support during the transition, and requiring browser drivers for many browsers. Selenium 4 completed the W3C WebDriver transition and introduced features such as relative locators, a redesigned Grid, and Selenium Manager in newer 4.x releases. Avoid saying Selenium 3 and Selenium 2 are identical.
TestNG annotations
TestNG annotations define lifecycle methods and test methods. Common annotations include @BeforeSuite, @BeforeTest, @BeforeClass, @BeforeMethod, @Test, @AfterMethod, @AfterClass, @AfterTest, and @AfterSuite. Setup annotations run at different scopes. @DataProvider supplies data-driven test inputs; @Parameters can receive values from test configuration. The exact order depends on suite configuration and inheritance. @BeforeMethod public void setUp() {.
Continuous Integration (CI) tools
CI automatically builds and tests changes when developers commit or merge code. Common tools include Jenkins, GitHub Actions, GitLab CI/CD, Azure Pipelines, and Bitbucket Pipelines. A Selenium pipeline typically checks out code, configures Java/Maven and browsers, runs tests, publishes reports, and archives logs/screenshots. Tests should be reliable, isolated, and configured for headless or remote browser execution where needed. # Example Maven command in a CI pipeline mvn clean test Interview tip: Name the tools you have actually used and explain the pipeline you personally worked with.
When is a defect deferred?
A defect is deferred when the team decides not to fix it in the current release or sprint and plans to reconsider it later. Reasons may include low severity or priority, limited business impact, a workaround, release constraints, dependency on another change, or insufficient time. The decision should be approved by the appropriate product/business stakeholders, documented with rationale, and assigned a future target or review point. Deferral is not the same as rejecting a valid defect.
What is GitHub?
GitHub is a cloud platform for hosting Git repositories and collaborating on code. Git is the version-control system; GitHub adds remote repositories, pull requests, reviews, issues, permissions, and automation through GitHub Actions. A typical workflow is clone, branch, edit, commit, push, open a pull request, review, and merge. git clone https://github.com/org/project.git git checkout -b feature/add-login-test git add . git commit -m "Add login automation test" git push -u origin feature/add-login-test Quick revision checklist • Explain WebDriver architecture clearly and distinguish browser automation from native desktop automation. • Know implicit wait vs explicit wait and why explicit.