TCS and Infosys QA Automation Interview Questions with Answers and Framework Scenarios
QA automation interviews at TCS and Infosys are usually practical. The interviewer wants to know whether you understand testing basics, can write Selenium or API automation logic, and can explain your framework without memorizing buzzwords.
This guide gives you a focused question bank with clear answers and real framework scenarios. Use it to revise fast, practice speaking your answers, and prepare for beginner to early intermediate QA automation roles.

Core QA automation questions asked in service company interviews
These questions test whether you understand what automation solves and where manual testing still matters.
1. What is QA automation?
QA automation means using tools and scripts to run test cases automatically. It helps with repeated checks such as login validation, form submission, regression testing, API response checks, and smoke testing.
A good answer should include this point:
Automation does not replace testing skills. It only helps execute repeatable checks faster and more consistently.
2. What types of test cases should be automated?
Automate test cases that are stable, repeated often, and have predictable results.
Good candidates include:
Smoke test cases
Regression test cases
Data-driven test cases
Cross-browser checks
API validation
Critical business flows like login, checkout, search, or payment status
Avoid automating test cases that change every sprint or need human judgment, such as visual layout review or exploratory testing.
3. What is the difference between manual testing and automation testing?
Manual testing | Automation testing |
A tester executes test cases by hand | Scripts execute test cases |
Better for exploratory testing | Better for repeated regression |
Slower for large test suites | Faster after setup |
Lower tool setup effort | Needs scripting and maintenance |
Useful for new or unstable features | Useful for stable features |
A strong interview answer should not say automation is always better. Say that both are useful in different situations.
4. What is regression testing?
Regression testing checks whether existing features still work after code changes. For example, if a team changes the payment page, regression testing can verify login, cart, checkout, order history, and payment confirmation flows.
Automation is common in regression testing because the same checks run again and again.
5. What is smoke testing?
Smoke testing checks whether the main build is stable enough for deeper testing. In a web app, smoke tests may include:
Open application URL
Verify login
Open dashboard
Search for an item
Log out
If smoke testing fails, the build may not be ready for full testing.
6. What is sanity testing?
Sanity testing checks a specific change or bug fix. If a defect was fixed in the password reset page, sanity testing focuses on that page and related flows.
A simple way to remember it:
Smoke testing checks build stability.
Sanity testing checks a specific change.
Selenium interview questions with answers
Selenium is one of the most common topics in a QA automation interview. Expect questions on locators, waits, actions, and test structure.

7. What is Selenium WebDriver?
Selenium WebDriver is a tool used to automate web browsers. It allows scripts to open a browser, click elements, type text, select values, and verify results.
Example in Java:
```java
WebDriver driver = new ChromeDriver();
driver.get("https://example.com");
driver.findElement(By.id("username")).sendKeys("testuser");
```
8. What are locators in Selenium?
Locators help Selenium find elements on a web page.
Common locators include:
`id`
`name`
`className`
`tagName`
`linkText`
`partialLinkText`
`cssSelector`
`xpath`
The best locator is usually a stable `id` or `name`. If those are not available, use CSS selector or XPath carefully.
9. What is the difference between absolute XPath and relative XPath?
Absolute XPath starts from the root of the HTML document.
Example:
```text
/html/body/div[1]/form/input[1]
```
Relative XPath starts from a specific element or condition.
Example:
```text
//input[@id='email']
```
Relative XPath is preferred because it is shorter and less likely to break when the page structure changes.
10. What is the difference between `findElement` and `findElements`?
`findElement` returns the first matching element. If no element is found, it throws an exception.
`findElements` returns a list of matching elements. If no element is found, it returns an empty list.
Example:
```java
List<WebElement> buttons = driver.findElements(By.tagName("button"));
if (buttons.size() > 0) {
System.out.println("Buttons found");
}
```
11. What are waits in Selenium?
Waits help Selenium handle loading time. Without waits, a script may fail because the page or element is not ready yet.
Common waits include:
Wait type | How it works |
Implicit wait | Applies a default wait for all elements |
Explicit wait | Waits for a specific condition |
Fluent wait | Similar to explicit wait, with polling and ignored exceptions |
Explicit wait is widely preferred because it gives better control.
Example:
```java
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
WebElement loginButton = wait.until(
ExpectedConditions.elementToBeClickable(By.id("login"))
);
```
12. What is the difference between `driver.close()` and `driver.quit()`?
`driver.close()` closes the current browser window.
`driver.quit()` closes all browser windows opened by the WebDriver session and ends the session.
In most test frameworks, use `driver.quit()` in teardown to release browser resources fully.
13. How do you handle dropdowns in Selenium?
If the dropdown uses a standard HTML `select` tag, use the `Select` class.
```java
WebElement country = driver.findElement(By.id("country"));
Select select = new Select(country);
select.selectByVisibleText("United States");
```
For custom dropdowns built with `div` or `ul` tags, click the dropdown and then click the required option using a locator.
14. How do you handle alerts?
Use the `Alert` interface.
```java
Alert alert = driver.switchTo().alert();
System.out.println(alert.getText());
alert.accept();
```
Use `dismiss()` to cancel an alert.
15. How do you handle multiple windows?
Store the parent window, get all window handles, switch to the required child window, then return to the parent.
```java
String parent = driver.getWindowHandle();
for (String window : driver.getWindowHandles()) {
if (!window.equals(parent)) {
driver.switchTo().window(window);
}
}
driver.close();
driver.switchTo().window(parent);
```
Java and TestNG questions that often appear
Most service-company automation roles expect basic Java and TestNG knowledge. You do not need to sound like a senior developer, but you should explain the logic clearly.
16. What are OOP concepts in Java?
The main OOP concepts are:
Encapsulation
Inheritance
Polymorphism
Abstraction
For automation, inheritance is often used in a base test class. Encapsulation is used in Page Object Model classes to keep locators and methods together.
17. What is method overloading?
Method overloading means having multiple methods with the same name but different parameters.
```java
public void login(String username, String password) {
// login with user credentials
}
public void login(String username, String password, String role) {
// login with role
}
```
18. What is method overriding?
Method overriding happens when a child class provides its own version of a method from the parent class.
```java
class BaseTest {
public void startBrowser() {
System.out.println("Start browser");
}
}
class ChromeTest extends BaseTest {
public void startBrowser() {
System.out.println("Start Chrome browser");
}
}
```
19. What is TestNG?
TestNG is a testing framework for Java. It helps organize and run automated tests.
Common TestNG annotations include:
`@Test`
`@BeforeMethod`
`@AfterMethod`
`@BeforeClass`
`@AfterClass`
`@DataProvider`
`@Parameters`
20. What is the use of `@DataProvider`?
`@DataProvider` helps run the same test with multiple sets of data. It is useful for login tests, form validation, and search tests.
```java
@DataProvider(name = "loginData")
public Object[][] getData() {
return new Object[][] {
{"user1", "pass1"},
{"user2", "pass2"}
};
}
```
21. What is the difference between `@BeforeMethod` and `@BeforeClass`?
`@BeforeMethod` runs before every test method.
`@BeforeClass` runs once before all test methods in a class.
Use `@BeforeMethod` for actions that must reset before each test, such as opening a fresh browser. Use `@BeforeClass` for setup that can be shared across methods.
QA automation framework scenarios and answers
Framework questions are very common because they show whether you have worked on real automation or at least understand how projects are built.

22. Explain your automation framework.
A simple answer can be:
“Our framework is based on Selenium WebDriver, Java, TestNG, and Maven. We use Page Object Model to keep page locators and page actions separate from test cases. Test data is stored in external files. Common methods are kept in utility classes. TestNG runs the test suite, and reports show passed, failed, and skipped tests.”
That answer covers the key parts without sounding memorized.
23. What is Page Object Model?
Page Object Model, often called POM, is a design pattern where each web page has a separate class. That class contains the locators and methods for that page.
Example:
```java
public class LoginPage {
WebDriver driver;
By username = By.id("username");
By password = By.id("password");
By loginButton = By.id("login");
public LoginPage(WebDriver driver) {
this.driver = driver;
}
public void login(String user, String pass) {
driver.findElement(username).sendKeys(user);
driver.findElement(password).sendKeys(pass);
driver.findElement(loginButton).click();
}
}
```
The test case becomes cleaner:
```java
LoginPage loginPage = new LoginPage(driver);
loginPage.login("testuser", "password123");
```
24. Why do we use Page Object Model?
Use POM because it makes tests easier to read and maintain. If a locator changes, update it in one page class instead of changing it in many test scripts.
25. What are the main components of a QA automation framework?
A beginner-friendly framework usually has these parts:
Component | Purpose |
Base class | Browser setup and teardown |
Page classes | Locators and page methods |
Test classes | Actual test cases |
Utility classes | Reusable actions and helpers |
Test data | Input values from files |
Config file | URL, browser, timeout values |
Reports | Test execution results |
Logs | Execution details for debugging |
26. How do you handle test data in a framework?
Common ways include Excel files, CSV files, JSON files, properties files, or databases.
For beginner automation projects, properties files are good for configuration values, while Excel, CSV, or JSON can be used for multiple data sets.
Example properties file:
```text
browser=chrome
timeout=10
```
27. What is a hybrid framework?
A hybrid framework combines more than one framework style. For example, it may use Page Object Model, data-driven testing, TestNG, and reusable utility methods together.
A simple interview answer:
“A hybrid framework helps us separate test logic, test data, page actions, and reusable methods, so the framework is easier to manage as test cases grow.”
28. How do you make your framework easier to maintain?
Good maintenance practices include:
Use clear naming for tests and methods
Keep locators inside page classes
Avoid duplicate code
Use explicit waits instead of hard sleeps
Store common actions in utility methods
Keep test data separate from test logic
Review failed tests before blaming the application
Avoid saying you use `Thread.sleep()` everywhere. It may work for a demo, but it makes tests slow and unreliable.
API and SQL questions for automation testers
TCS and Infosys QA automation interviews may include API and database basics, especially for projects that combine UI, API, and backend validation.

29. What is API testing?
API testing checks the communication between systems. Instead of clicking a user interface, the tester sends requests and verifies responses.
For example, a login API may return a token when valid credentials are sent.
30. What are common HTTP methods?
Method | Use |
GET | Read data |
POST | Create data |
PUT | Update full data |
PATCH | Update partial data |
DELETE | Remove data |
31. What status codes should a QA tester know?
Common status codes include:
`200` means OK
`201` means created
`400` means bad request
`401` means unauthorized
`403` means forbidden
`404` means not found
`500` means server error
32. How do you validate an API response?
Check the status code, response body, headers, response time, and important fields.
Example checks:
Response status is `200`
Response contains expected user ID
Error message appears for invalid input
Required fields are not null
Response format is valid JSON
33. What SQL queries should automation testers know?
Basic SQL is often enough for beginner QA roles.
Examples:
```sql
SELECT * FROM users;
SELECT * FROM orders WHERE status = 'Completed';
SELECT COUNT(*) FROM products;
```
You may also be asked about joins.
```sql
SELECT users.name, orders.order_id
FROM users
INNER JOIN orders
ON users.id = orders.user_id;
```
Scenario based questions with strong sample answers
Scenario questions show how you think. Keep answers structured and realistic.
34. A Selenium test fails randomly. What will you check?
Start with timing and stability.
Strong answer:
“I would check whether the element is loading late, whether the locator is stable, and whether the test data changes between runs. I would use explicit wait, verify the element state, check screenshots or logs, and rerun the test individually. If it still fails, I would inspect the application behavior and browser console.”
35. Login works manually but fails in automation. What could be wrong?
Possible reasons include:
Wrong locator
Page not fully loaded
Captcha blocks automation
Test user is locked
Password changed
Browser popup appears
Environment issue
Input field clears after typing
A good answer should show debugging, not guessing.
36. How would you automate a login page?
Explain the flow clearly:
Launch the browser.
Open the application URL.
Enter username and password.
Click the login button.
Wait for the home page.
Verify a dashboard element or user profile.
Close the browser.
Then mention that you would add negative tests for invalid credentials, blank fields, and locked users.
37. How would you design a framework for a small web application?
A beginner answer can be:
“I would use Java, Selenium, TestNG, Maven, and Page Object Model. I would create page classes for login, dashboard, and key modules. I would keep browser setup in a base class, test data in separate files, and common actions in utility classes. TestNG XML would run smoke and regression suites.”
This answer is simple and acceptable for many entry-level discussions.
38. How do you report a bug found during automation?
Include the same details as manual testing:
Clear title
Steps to reproduce
Expected result
Actual result
Test data used
Browser and environment
Screenshot or log
Build version if available
Automation does not remove the need for good bug reporting.
39. What will you do if a test passes locally but fails in a pipeline?
Mention environment checks.
Strong answer:
“I would compare browser versions, driver versions, environment URLs, test data, timing, and configuration values. I would also check whether the pipeline runs tests in headless mode and review logs or screenshots captured during failure.”
40. What should be included in a daily automation status update?
Keep it short and useful:
Tests automated
Tests executed
Passed and failed count
Defects found
Blockers
Next planned work
Do not exaggerate progress. Interviewers prefer clear communication.
Final preparation tips for TCS and Infosys QA automation interviews
The best way to prepare is to practice answers out loud and build one small project that you can explain end to end. A simple login and search automation project with Selenium, Java, TestNG, Maven, and Page Object Model is enough for many beginner roles.
Before the interview, revise these areas:
Manual testing basics
SDLC and STLC
Selenium locators and waits
Java OOP concepts
TestNG annotations
Page Object Model
Basic API testing
Basic SQL queries
Framework structure
Real debugging scenarios
If you are preparing TCS and Infosys QA Automation Interview Questions with Answers and Framework Scenarios, focus less on memorizing perfect definitions and more on explaining your thought process. A clear, honest answer with a small example often beats a complex answer that sounds copied.
Build one test flow, understand every line, and practice explaining why you wrote it that way. That is what helps you stand out in a QA automation interview.








Comments