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
Selenium Automation Tester
Clear (1)

Cognizant Selenium Automation Tester Interview Questions and Answers

Updated 16 Jan 2025

Q1. How to get the count of all text box in a web page?

Ans.

Use Selenium WebDriver to find and count all text boxes on a web page.

  • Use Selenium WebDriver to locate all text boxes on the web page

  • Use findElements method with input tag and type attribute as text to find all text boxes

  • Get the size of the list of elements to get the count of text boxes

View 5 more answers
right arrow

Q2. How to reduce execution time in selenium?

Ans.

To reduce execution time in Selenium, optimize test scripts, use efficient locators, and run tests in parallel.

  • Optimize test scripts by removing unnecessary steps and reducing wait times

  • Use efficient locators such as CSS selectors instead of XPath

  • Run tests in parallel using tools like Selenium Grid or TestNG

  • Use headless browsers like PhantomJS to speed up tests

  • Use page object model to reduce code duplication and improve maintainability

Add your answer
right arrow

Q3. How to upload resume using Selenium

Ans.

To upload resume using Selenium, use sendKeys() method to locate the file input element and pass the file path.

  • Locate the file input element using any of the locators like id, name, class, etc.

  • Use sendKeys() method to pass the file path to the file input element.

  • Click on the submit button to upload the file.

Add your answer
right arrow

Q4. Difference between red only and constants?

Ans.

Red only is a type of constant used in Selenium to locate web elements based on their color.

  • Red only is used to locate elements that have a specific color, such as a red button.

  • Constants are variables that hold a fixed value and are used in Selenium to make code more readable and maintainable.

  • Red only is a type of constant that holds the value 'red' and is used in conjunction with other locators, such as ID or class name.

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

Q5. Explain implicit and explicit wait?

Ans.

Implicit wait is a global wait applied to all elements, while explicit wait is a specific wait applied to a particular element or condition.

  • Implicit wait is set once and applied to all elements in the script

  • Explicit wait is set for a specific element or condition

  • Implicit wait is defined at the driver level

  • Explicit wait is defined at the element level

  • Implicit wait is used to wait for elements to appear on the page

  • Explicit wait is used to wait for a specific condition to occur

  • I...read more

View 4 more answers
right arrow

Q6. Explain collections, Framework used?

Ans.

Collections are used to store and manipulate groups of objects. Frameworks used in Selenium automation testing include TestNG, JUnit, and Cucumber.

  • Collections are used to store and manipulate groups of objects

  • Frameworks used in Selenium automation testing include TestNG, JUnit, and Cucumber

Add your answer
right arrow

Q7. Explain interface

Ans.

An interface is a contract between two entities that defines the communication between them.

  • An interface defines a set of methods that a class must implement.

  • It provides a way to achieve abstraction and loose coupling.

  • Interfaces can be used to achieve multiple inheritance in Java.

  • Example: Java's Comparable interface defines a method to compare objects.

  • Example: Selenium WebDriver interface defines methods to interact with web elements.

Add your answer
right arrow

Q8. Syntax of Explicit wait

Ans.

Explicit wait is a mechanism in Selenium that allows the automation tester to wait for a certain condition to occur before proceeding further.

  • Syntax: WebDriverWait wait = new WebDriverWait(driver, timeoutInSeconds);

  • wait.until(ExpectedConditions.condition);

  • Example: WebDriverWait wait = new WebDriverWait(driver, 10);

  • wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("elementId")));

Add your answer
right arrow

Q9. 5 error codes of sql

Ans.

5 common SQL error codes and their meanings

  • Error code 1062: Duplicate entry - occurs when trying to insert a record with a primary key that already exists

  • Error code 1146: Table not found - occurs when trying to query a table that does not exist

  • Error code 1045: Access denied - occurs when trying to access a database without proper permissions

  • Error code 1054: Unknown column - occurs when referencing a column that does not exist in a table

  • Error code 1215: Cannot add foreign key ...read more

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 Selenium Automation Tester

based on 3 interviews
1 Interview rounds
Technical Round
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Selenium Automation Tester Interview Questions from Similar Companies

View all
Recently Viewed
COMPANY BENEFITS
ICICI Bank
Junagadh
1 benefits
COMPANY BENEFITS
ICICI Bank
Kakinada
6 benefits
SALARIES
Capgemini
SALARIES
Capgemini
SALARIES
Capgemini
SALARIES
Deutsche Bank
SALARIES
IndusInd Bank
SALARIES
NatWest Group
DESIGNATION
SALARIES
IndusInd Bank
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