Add office photos
Cognizant logo
Engaged Employer

Cognizant

Verified
3.7
based on 50.6k Reviews
Video summary
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
Automation Test Engineer
Fresher
Experienced
Clear (2)

Cognizant Automation Test Engineer Interview Questions and Answers for Freshers

Updated 12 Dec 2024

Q1. How to identify object in Selenium

Ans.

To identify objects in Selenium, we use locators such as ID, Name, Class Name, XPath, CSS Selector, etc.

  • Locators are used to identify web elements on a page

  • ID and Name are the most commonly used locators

  • XPath and CSS Selector are more powerful but slower

  • Class Name is useful for identifying multiple elements with the same class

  • Locators can be used with findElement() and findElements() methods

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

Add your answer
right arrow

Q2. 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 and step definitions together form the basis of Behavior Dr...read more

Add your answer
right arrow

Q3. 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.

Add your answer
right arrow

Q4. 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 strategy for testing, including objectives, resources, schedule

  • T...read more

Add your answer
right arrow
Discover Cognizant interview dos and don'ts from real experiences

Q5. 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, while relative Xpath is more flexible and resilient to c...read more

Add your answer
right arrow

Q6. 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);

Add your answer
right arrow

Q7. 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

Add your answer
right arrow

Q8. 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-catch blocks or using Selenium's built-in exception handli...read more

Add your answer
right arrow

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.

Add your answer
right arrow

More about working at Cognizant

Back
Awards Leaf
AmbitionBox Logo
Top Rated Mega Company - 2024
Awards Leaf
Awards Leaf
AmbitionBox Logo
Top Rated IT/ITES Company - 2024
Awards Leaf
HQ - Teaneck. New Jersey., United States (USA)
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos

Interview Process at Cognizant Automation Test Engineer for Freshers

based on 3 interviews
Interview experience
4.3
Good
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Automation Test Engineer Interview Questions from Similar Companies

View all
Recently Viewed
INTERVIEWS
NXTDIGITAL
No Interviews
REVIEWS
HGS
No Reviews
LIST OF COMPANIES
Society for Electronic Transactions & Security
Locations
SALARIES
HGS
No Salaries
SALARIES
Society for Electronic Transactions & Security
LIST OF COMPANIES
Society for Electronic Transactions & Security
Overview
LIST OF COMPANIES
Sun Pharmaceutical Industries
Locations
LIST OF COMPANIES
Kotak Mahindara Life Insurance
Locations
INTERVIEWS
National Productivity Council
No Interviews
LIST OF COMPANIES
Indian Oil Corporation
Locations
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter