Upload Button Icon Add office photos
Engaged Employer

i

This company page is being actively managed by Cognizant Team. If you also belong to the team, you can get access from here

Cognizant Verified Tick

Compare button icon Compare button icon Compare

Filter interviews by

Cognizant Automation Test Engineer Interview Questions and Answers

Updated 9 May 2025

37 Interview questions

An Automation Test Engineer was asked 2mo ago
Q. Explain different types of waits.
Ans. 

Waits in automation testing manage timing issues between test execution and application response.

  • Implicit Wait: Sets a default wait time for the entire session. Example: driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

  • Explicit Wait: Waits for a specific condition to occur before proceeding. Example: WebDriverWait wait = new WebDriverWait(driver, 10); wait.until(ExpectedConditions.visibilityOf(eleme...

An Automation Test Engineer was asked 2mo ago
Q. Write Selenium code to handle nested frames.
Ans. 

Handling nested frames in Selenium requires switching context to access elements within them.

  • Use driver.switchTo().frame('frameName') to switch to the outer frame.

  • For nested frames, switch to the inner frame using driver.switchTo().frame('innerFrameName').

  • Always switch back to the default content using driver.switchTo().defaultContent() after operations.

  • Example: To access an element in a nested frame, use: driver....

Automation Test Engineer Interview Questions Asked at Other Companies

asked in TCS
Q1. How to handle scrollbar and mouse activities Jenkins and Github S ... read more
asked in Infosys
Q2. Introduce yourself 1.What is STLC 2. difference between Test plan ... read more
asked in LTIMindtree
Q3. 1. diff b/w findelements vs findelement? 2. set vs map? 3. wap fo ... read more
asked in Capgemini
Q4. 1] Introduction 2] Sanity Vs Smoke testing 3] Waits in selenium a ... read more
asked in Capgemini
Q5. What is assertion? What is soft assertion? What is hard assertion ... read more
An Automation Test Engineer was asked 3mo ago
Q. Write a Java program to identify if a string is a palindrome.
Ans. 

This Java program checks if a given string is a palindrome, meaning it reads the same forwards and backwards.

  • A palindrome is a word, phrase, or sequence that reads the same backward as forward. Example: 'madam'.

  • To check for a palindrome, compare characters from the start and end of the string.

  • Ignore spaces, punctuation, and case sensitivity for accurate results. Example: 'A man, a plan, a canal, Panama!' is a pali...

An Automation Test Engineer was asked 3mo ago
Q. Write an XPath query to locate the menu bar on the Amazon website.
Ans. 

XPath for the Amazon menu bar helps locate elements for automated testing and web scraping.

  • Use '//*[@id="nav-main"]' to select the main navigation bar.

  • To select a specific menu item, use '//*[@id="nav-main"]/descendant::a[text()="Today's Deals"]'.

  • Utilize '//*[contains(@class, "nav-line-1")]' to find menu items with specific class attributes.

What people are saying about Cognizant

View All
a junior software engineer
1w
Job offer in Malaysia - legit or scam?
Hey everyone, I received a job proposal from Mindgraph for a Junior Mainframe Developer position in Malaysia (onsite). Not sure if it's a real deal. They found my resume on Naukri and the offer includes: * Experience: 3+ years on cardlink, VSAM, CICS, JCL * Location: Malaysia (Accenture client in Kuala Lumpur) * Notice: 0-60 days * Benefits: One-way ticket, 1-week stay, medical insurance, visa. Has anyone heard of Mindgraph or had a similar experience? Note : This is a permanent position with Mindgragh and you need to work with our client Accenture - Malaysia (Kaula Lumpur) & we will provide one way Air Ticket from India - Malaysia, 1 Week Accommodation, Medical Insurance and will take care of the Visa process also. Any insights would be appreciated!
Got a question about Cognizant?
Ask anonymously on communities.
An Automation Test Engineer was asked 3mo ago
Q. What is your framework, and how is it used in software development?
Ans. 

My framework is a combination of tools, libraries, and guidelines used to develop and execute automated tests efficiently.

  • My framework includes tools like Selenium for web automation and Appium for mobile automation.

  • It also includes libraries like TestNG for test execution and reporting.

  • Guidelines in my framework help in structuring tests, handling test data, and maintaining code reusability.

  • For example, I use Pag...

An Automation Test Engineer was asked 6mo ago
Q. What are the different types of waits in Selenium?
Ans. 

Types of waits in Selenium include Implicit Wait, Explicit Wait, and Fluent Wait.

  • Implicit Wait: Waits for a certain amount of time before throwing a NoSuchElementException.

  • Explicit Wait: Waits for a certain condition to occur before proceeding further in the code.

  • Fluent Wait: Waits for a condition to be true with a defined polling frequency.

  • Example: driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

An Automation Test Engineer was asked 6mo ago
Q. How do you input data in Cucumber?
Ans. 

Data can be input in Cucumber using feature files and step definitions.

  • Data can be input in feature files using scenarios and scenario outlines

  • Step definitions can be used to define the actions to be taken with the input data

  • Data tables can be used in feature files to input structured data

  • Examples keyword can be used in scenario outlines to provide multiple sets of input data

Are these interview questions helpful?
An Automation Test Engineer was asked 6mo ago
Q. What are feature files and step definitions in Cucumber BDD?
Ans. 

Feature files contain high-level description of the functionality to be tested, while step definitions are the implementation of the steps in the feature file using code.

  • Feature files are written in Gherkin syntax and describe the behavior of the application in plain text.

  • Step definitions are written in programming languages like Java, Ruby, etc., and map the steps in the feature file to automation code.

  • Feature fi...

An Automation Test Engineer was asked 6mo ago
Q. What are exceptions in Selenium?
Ans. 

Exceptions in Selenium are errors that occur during test execution, disrupting the flow of the test script.

  • Exceptions are thrown when there is an unexpected behavior in the application under test or in the test script itself.

  • Common exceptions in Selenium include NoSuchElementException, ElementNotVisibleException, TimeoutException, and StaleElementReferenceException.

  • Handling exceptions in Selenium can be done using...

An Automation Test Engineer was asked 6mo ago
Q. What will be returned if multiple tabs are open?
Ans. 

The return would be the number of tabs open in the browser.

  • The return value would be an integer representing the count of open tabs.

  • For example, if there are 5 tabs open, the return value would be 5.

Cognizant Automation Test Engineer Interview Experiences

27 interviews found

Interview experience
5
Excellent
Difficulty level
Easy
Process Duration
Less than 2 weeks
Result
Not Selected

I applied via Naukri.com and was interviewed in Nov 2024. There was 1 interview round.

Round 1 - Technical 

(9 Questions)

  • Q1. Difference between absolute and relative Xpath
  • Ans. 

    Absolute Xpath starts from the root element, while relative Xpath starts from any node in the DOM structure.

    • Absolute Xpath starts with a single forward slash (/) and starts selection from the root node.

    • Relative Xpath starts with a double forward slash (//) and starts selection from the current node or any node in the DOM structure.

    • Absolute Xpath is more brittle and prone to breaking if the structure of the page changes...

  • Answered by AI
  • Q2. What would be return if multiple tabs are open
  • Ans. 

    The return would be the number of tabs open in the browser.

    • The return value would be an integer representing the count of open tabs.

    • For example, if there are 5 tabs open, the return value would be 5.

  • Answered by AI
  • Q3. What are the waits in selenium
  • Ans. 

    Types of waits in Selenium include Implicit Wait, Explicit Wait, and Fluent Wait.

    • Implicit Wait: Waits for a certain amount of time before throwing a NoSuchElementException.

    • Explicit Wait: Waits for a certain condition to occur before proceeding further in the code.

    • Fluent Wait: Waits for a condition to be true with a defined polling frequency.

    • Example: driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

  • Answered by AI
  • Q4. Exceptions in selenium
  • Ans. 

    Exceptions in Selenium are errors that occur during test execution, disrupting the flow of the test script.

    • Exceptions are thrown when there is an unexpected behavior in the application under test or in the test script itself.

    • Common exceptions in Selenium include NoSuchElementException, ElementNotVisibleException, TimeoutException, and StaleElementReferenceException.

    • Handling exceptions in Selenium can be done using try-...

  • Answered by AI
  • Q5. What is feature and step definitions in cucumber BDD
  • Ans. 

    Feature files contain high-level description of the functionality to be tested, while step definitions are the implementation of the steps in the feature file using code.

    • Feature files are written in Gherkin syntax and describe the behavior of the application in plain text.

    • Step definitions are written in programming languages like Java, Ruby, etc., and map the steps in the feature file to automation code.

    • Feature files a...

  • Answered by AI
  • Q6. How to input data in cucumber
  • Ans. 

    Data can be input in Cucumber using feature files and step definitions.

    • Data can be input in feature files using scenarios and scenario outlines

    • Step definitions can be used to define the actions to be taken with the input data

    • Data tables can be used in feature files to input structured data

    • Examples keyword can be used in scenario outlines to provide multiple sets of input data

  • Answered by AI
  • Q7. Basic Java questions like access modifiers, method overloading and overriding
  • Q8. What is Test case, Test plan and Test Secenarios
  • Ans. 

    Test case is a set of conditions or variables under which a tester will determine whether a system under test satisfies requirements. Test plan is a document outlining the scope, approach, resources, and schedule of testing activities. Test scenarios are detailed descriptions of possible interactions with the system.

    • Test case: specific conditions to be tested, expected results, steps to execute

    • Test plan: overall strate...

  • Answered by AI
  • Q9. Hooks in Java
  • Ans. 

    Hooks in Java are methods that allow subclasses to override or extend the behavior of a superclass.

    • Hooks are commonly used in frameworks like JUnit and TestNG for test automation.

    • They are often used for setup and teardown operations before and after test methods.

    • Examples include @Before, @After, @BeforeClass, and @AfterClass annotations in JUnit.

  • Answered by AI

Interview Preparation Tips

Interview preparation tips for other job seekers - The second round interview was quite challenging, with numerous questions focused on core Java topics such as data structures and linked lists. It felt less like a testing interview and more akin to a developer interview.

Skills evaluated in this interview

Interview experience
2
Poor
Difficulty level
-
Process Duration
-
Result
-
Round 1 - One-on-one 

(3 Questions)

  • Q1. What is your framework, and how is it used in software development?
  • Ans. 

    My framework is a combination of tools, libraries, and guidelines used to develop and execute automated tests efficiently.

    • My framework includes tools like Selenium for web automation and Appium for mobile automation.

    • It also includes libraries like TestNG for test execution and reporting.

    • Guidelines in my framework help in structuring tests, handling test data, and maintaining code reusability.

    • For example, I use Page Obj...

  • Answered by AI
  • Q2. Java code scenario based
  • Q3. Utilities used
  • Ans. 

    Various utilities used in automation testing include Selenium, JUnit, TestNG, Jenkins, Git, and Docker.

    • Selenium for web automation testing

    • JUnit and TestNG for unit testing

    • Jenkins for continuous integration

    • Git for version control

    • Docker for containerization

  • Answered by AI
Interview experience
4
Good
Difficulty level
Easy
Process Duration
Less than 2 weeks
Result
Not Selected

I applied via Naukri.com and was interviewed in Oct 2024. There was 1 interview round.

Round 1 - Technical 

(5 Questions)

  • Q1. Write a program for string reverse?
  • Ans. 

    Program to reverse an array of strings

    • Iterate through each string in the array and reverse it using built-in functions or manual reversal logic

    • Store the reversed strings in a new array or overwrite the original array

    • Return the reversed array of strings

  • Answered by AI
  • Q2. What is meant by CRM?
  • Ans. 

    CRM stands for Customer Relationship Management. It refers to strategies, technologies, and practices that companies use to manage and analyze customer interactions and data throughout the customer lifecycle.

    • CRM helps businesses build and maintain relationships with customers

    • It involves using technology to organize, automate, and synchronize sales, marketing, customer service, and technical support

    • Examples of CRM softw...

  • Answered by AI
  • Q3. What is data provider in testNg?
  • Ans. 

    Data provider in TestNG is used to supply test data to test methods.

    • Data provider is a method annotated with @DataProvider that returns a 2D array of test data.

    • Test methods can be linked to data provider using 'dataProvider' attribute in @Test annotation.

    • Data provider helps in running the same test method with multiple sets of data.

    • It helps in data-driven testing where test data is separated from test logic.

  • Answered by AI
  • Q4. Can you please take xpath in dynamic way?
  • Ans. 

    Yes, dynamic xpath can be created using functions like contains, starts-with, and variables.

    • Use functions like contains() and starts-with() to create dynamic xpaths based on partial attribute values

    • Use variables to store dynamic values and use them in xpaths

    • Example: //div[contains(@class, 'dynamicClass')]

    • Example: //input[starts-with(@id, 'dynamicId')]

  • Answered by AI
  • Q5. Some Questions on oops concepts

Skills evaluated in this interview

Interview experience
4
Good
Difficulty level
Moderate
Process Duration
2-4 weeks
Result
No response

I applied via Company Website and was interviewed in Aug 2024. There was 1 interview round.

Round 1 - Technical 

(9 Questions)

  • Q1. Java Basics -- method overloading and overriding, diff b/w interface and abstract class, Abstraction in oops concept, star program, prime no. Or not program
  • Q2. Selenium BDD framework structure
  • Q3. How to convert JSON file into Java object
  • Ans. 

    Use libraries like Jackson or Gson to convert JSON file into Java object

    • Use libraries like Jackson or Gson for easy conversion

    • Create a POJO class that represents the structure of JSON data

    • Use ObjectMapper class in Jackson or Gson.fromJson() method to convert JSON file into Java object

  • Answered by AI
  • Q4. Different annotations use in Junit hooks
  • Ans. 

    Different annotations used in JUnit hooks

    • Annotations like @Before, @After, @BeforeClass, @AfterClass are used in JUnit hooks

    • These annotations help in setting up and tearing down test fixtures before and after test methods

    • Example: @Before public void setUp() { // setup code }

  • Answered by AI
  • Q5. One scenario based on hooks
  • Ans. 

    Hooks in automation testing allow setup and teardown actions to be executed before or after tests, enhancing test management.

    • Hooks can be used to initialize test data before tests run, e.g., creating a user account.

    • Teardown hooks can clean up resources after tests, like deleting test data from the database.

    • Before hooks can be used to set up browser configurations, e.g., setting the viewport size in Selenium.

    • After hooks...

  • Answered by AI
  • Q6. Background keyword in BDD
  • Ans. 

    Background keyword in BDD is used to define preconditions for a scenario

    • Background keyword is used to define steps that are common to all scenarios in a feature file

    • It helps in reducing duplication of steps in scenarios

    • Background keyword is placed before the first scenario in a feature file

  • Answered by AI
  • Q7. Different types of exceptions while executing test cases
  • Ans. 

    Different types of exceptions encountered while executing test cases

    • 1. Checked exceptions: Must be caught or declared in the method signature

    • 2. Unchecked exceptions: Not required to be caught or declared

    • 3. Runtime exceptions: Occur during runtime due to logical errors

    • 4. Assertion errors: Failures in assertions made in the test cases

    • 5. Timeout exceptions: Test case takes longer than expected to complete

  • Answered by AI
  • Q8. Syntax of Drag and Drop
  • Ans. 

    Drag and Drop is a common interaction in web applications where a user can click and drag an element to a new location.

    • Drag and Drop is implemented using HTML5's Drag and Drop API.

    • The syntax involves setting the draggable attribute to true on the element you want to drag.

    • You also need to define event handlers for dragstart, dragover, and drop events.

    • Example:

      Drag me!

  • Answered by AI
  • Q9. Syntax for Pinch and zoom
  • Ans. 

    Pinch and zoom syntax is used to zoom in and out on touch screen devices.

    • Use two fingers to pinch inwards to zoom out

    • Use two fingers to pinch outwards to zoom in

    • For zooming, use the 'transform' property in CSS

  • Answered by AI

Interview Preparation Tips

Interview preparation tips for other job seekers - Prepare according to Job Description. Focus on Java Basics and selenium basics

Skills evaluated in this interview

Interview experience
4
Good
Difficulty level
Moderate
Process Duration
Less than 2 weeks
Result
Not Selected

I appeared for an interview in Apr 2025, where I was asked the following questions.

  • Q1. Questions from current project work
  • Q2. Agile methodologies
  • Q3. 2 java programs - 1.print the same characters in the given 2 strings in java 2. Print the occurrence count of characters in a string
  • Ans. 

    Java programs to find common characters in two strings and count character occurrences in a string.

    • Common Characters: Use a HashSet to store characters from both strings and find intersections. Example: 'hello' and 'world' yield 'lo'.

    • Character Occurrence: Utilize a HashMap to count occurrences of each character in a string. Example: 'hello' results in {h=1, e=1, l=2, o=1}.

  • Answered by AI
Interview experience
5
Excellent
Difficulty level
Moderate
Process Duration
Less than 2 weeks
Result
-

I applied via Referral and was interviewed in Aug 2024. There was 1 interview round.

Round 1 - One-on-one 

(3 Questions)

  • Q1. Xpath Types and Gave some scenarios to be checked
  • Q2. Oops Concept from Java
  • Ans. 

    Oops Concept from Java refers to Object-Oriented Programming principles like Inheritance, Encapsulation, Polymorphism, and Abstraction.

    • Inheritance allows a class to inherit properties and behavior from another class.

    • Encapsulation involves bundling data and methods that operate on the data into a single unit.

    • Polymorphism allows objects to be treated as instances of their parent class.

    • Abstraction hides the implementation...

  • Answered by AI
  • Q3. Previous project explanation and work nature
  • Ans. 

    Developed automation test scripts for web applications using Selenium and Java

    • Created test cases based on requirements and executed them using Selenium WebDriver

    • Performed regression testing to ensure the stability of the application

    • Collaborated with developers to identify and resolve defects

    • Used TestNG framework for test execution and reporting

    • Implemented data-driven testing using Excel sheets for input data

  • Answered by AI

Skills evaluated in this interview

Interview experience
5
Excellent
Difficulty level
Moderate
Process Duration
4-6 weeks
Result
Selected Selected

I applied via Naukri.com and was interviewed in Jul 2024. There were 2 interview rounds.

Round 1 - Technical 

(2 Questions)

  • Q1. Difference between findElement and findElements
  • Ans. 

    findElement returns the first matching element on the page, while findElements returns a list of all matching elements.

    • findElement returns a single WebElement matching the specified locator, while findElements returns a list of WebElements.

    • findElement will throw NoSuchElementException if no matching element is found, while findElements will return an empty list.

    • Example: driver.findElement(By.id("username")) vs driver.f...

  • Answered by AI
  • Q2. Implicitwait and explicit wait difference
  • Ans. 

    Implicit wait is set globally for the entire duration of the WebDriver session, while explicit wait is applied only to specific elements.

    • Implicit wait is set using driver.manage().timeouts().implicitlyWait() method, while explicit wait is implemented using WebDriverWait class in Selenium.

    • Implicit wait is used to wait for elements to be present in the DOM, while explicit wait is used to wait for specific conditions to b...

  • Answered by AI
Round 2 - HR 

(2 Questions)

  • Q1. Tell me about yourself
  • Ans. 

    I am a dedicated Automation Test Engineer with 5 years of experience in creating and executing test cases for software applications.

    • Experienced in creating automated test scripts using tools like Selenium and Appium

    • Proficient in identifying bugs and issues in software applications

    • Skilled in writing test plans and test cases to ensure comprehensive test coverage

    • Strong understanding of Agile methodologies and continuous ...

  • Answered by AI
  • Q2. Salary expectation

Skills evaluated in this interview

Interview experience
1
Bad
Difficulty level
Moderate
Process Duration
Less than 2 weeks
Result
No response

I appeared for an interview in Feb 2025, where I was asked the following questions.

  • Q1. Java program related to string and array
  • Ans. 

    Java program to manipulate an array of strings, demonstrating common operations like sorting and searching.

    • 1. Creating an array of strings: String[] fruits = {"Apple", "Banana", "Cherry"};

    • 2. Sorting the array: Arrays.sort(fruits); // fruits will be sorted alphabetically.

    • 3. Searching for an element: boolean found = Arrays.asList(fruits).contains("Banana"); // returns true if found.

    • 4. Joining strings: String result = Str...

  • Answered by AI
  • Q2. Explain about waits
  • Ans. 

    Waits in automation testing manage timing issues between test execution and application response.

    • Implicit Wait: Sets a default wait time for the entire session. Example: driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

    • Explicit Wait: Waits for a specific condition to occur before proceeding. Example: WebDriverWait wait = new WebDriverWait(driver, 10); wait.until(ExpectedConditions.visibilityOf(element));

    • ...

  • Answered by AI
  • Q3. Nested frames related selenium code
  • Ans. 

    Handling nested frames in Selenium requires switching context to access elements within them.

    • Use driver.switchTo().frame('frameName') to switch to the outer frame.

    • For nested frames, switch to the inner frame using driver.switchTo().frame('innerFrameName').

    • Always switch back to the default content using driver.switchTo().defaultContent() after operations.

    • Example: To access an element in a nested frame, use: driver.switc...

  • Answered by AI
Interview experience
3
Average
Difficulty level
-
Process Duration
-
Result
-
Round 1 - Aptitude Test 

Need to give Assessment on Amcat

Round 2 - Technical 

(1 Question)

  • Q1. Virtually, basic question related to your programming language, Project
Interview experience
5
Excellent
Difficulty level
-
Process Duration
-
Result
-
Round 1 - One-on-one 

(2 Questions)

  • Q1. All java oops questions
  • Q2. Selenium basic questions

Cognizant Interview FAQs

How many rounds are there in Cognizant Automation Test Engineer interview?
Cognizant interview process usually has 1-2 rounds. The most common rounds in the Cognizant interview process are Technical, One-on-one Round and HR.
How to prepare for Cognizant Automation Test Engineer interview?
Go through your CV in detail and study all the technologies mentioned in your CV. Prepare at least two technologies or languages in depth if you are appearing for a technical interview at Cognizant. The most common topics and skills that interviewers at Cognizant expect are Selenium, Java, Automation Testing, Cucumber and Selenium Testing.
What are the top questions asked in Cognizant Automation Test Engineer interview?

Some of the top questions asked at the Cognizant Automation Test Engineer interview -

  1. 5. Git repository . How to push and pull co...read more
  2. 2. TestNg and it's annotations and order of executi...read more
  3. Mention some popular tools used for automation testi...read more
How long is the Cognizant Automation Test Engineer interview process?

The duration of Cognizant Automation Test Engineer interview process can vary, but typically it takes about less than 2 weeks to complete.

Tell us how to improve this page.

Overall Interview Experience Rating

3.7/5

based on 21 interview experiences

Difficulty level

Easy 23%
Moderate 77%

Duration

Less than 2 weeks 69%
2-4 weeks 23%
4-6 weeks 8%
View more
Cognizant Automation Test Engineer Salary
based on 2k salaries
₹2.2 L/yr - ₹13.4 L/yr
At par with the average Automation Test Engineer Salary in India
View more details

Cognizant Automation Test Engineer Reviews and Ratings

based on 123 reviews

3.8/5

Rating in categories

3.6

Skill development

3.7

Work-life balance

3.0

Salary

3.5

Job security

3.6

Company culture

2.8

Promotions

3.5

Work satisfaction

Explore 123 Reviews and Ratings
Automation Test Engineer

Hyderabad / Secunderabad,

Chennai

+1

6-11 Yrs

Not Disclosed

Salesforce Automation/ Automation Test Engineer | 4+ Years | PAN India

Hyderabad / Secunderabad,

Chennai

+1

4-9 Yrs

Not Disclosed

Explore more jobs
Associate
73.2k salaries
unlock blur

₹5.1 L/yr - ₹14.4 L/yr

Programmer Analyst
56.2k salaries
unlock blur

₹2 L/yr - ₹8 L/yr

Senior Associate
52.8k salaries
unlock blur

₹9 L/yr - ₹28.8 L/yr

Senior Processing Executive
29.8k salaries
unlock blur

₹1.4 L/yr - ₹9 L/yr

Technical Lead
18.1k salaries
unlock blur

₹6 L/yr - ₹25.5 L/yr

Explore more salaries
Compare Cognizant with

TCS

3.6
Compare

Infosys

3.6
Compare

Wipro

3.7
Compare

Accenture

3.8
Compare
write
Share an Interview