i
Cognizant
Proud winner of ABECA 2024 - AmbitionBox Employee Choice Awards
Filter interviews by
I applied via Naukri.com
I applied via Company Website and was interviewed in Oct 2020. There were 4 interview rounds.
Answering types of waits, types of exceptions, and oops concepts for QA Engineer Automation QA.Selenium
Types of waits include implicit, explicit, and fluent waits
Types of exceptions include checked and unchecked exceptions
Oops concepts include inheritance, polymorphism, and encapsulation
What people are saying about Cognizant
posted on 22 May 2021
There are several locators used in Selenium such as ID, Name, Class Name, Tag Name, Link Text, and Partial Link Text.
ID - unique identifier for an element
Name - name attribute of an element
Class Name - class attribute of an element
Tag Name - HTML tag name of an element
Link Text - exact text of a link element
Partial Link Text - partial text of a link element
Abstract classes are partially implemented classes while interfaces are fully abstract classes.
Abstract classes can have both implemented and abstract methods while interfaces can only have abstract methods.
A class can only inherit from one abstract class but can implement multiple interfaces.
Abstract classes can have constructors while interfaces cannot.
Abstract classes can have instance variables while interfaces can...
Different design techniques for QA automation
Data-driven testing
Keyword-driven testing
Behavior-driven development
Model-based testing
Exploratory testing
TakeScreenshot method in Selenium captures a screenshot of the current web page.
Create an object of the TakesScreenshot interface
Use the getScreenshotAs() method to capture the screenshot
Save the screenshot to a file or display it in the console
Overloading is having multiple methods with the same name but different parameters. Overriding is having a method in child class with the same name and signature as in parent class.
Overloading is compile-time polymorphism while overriding is runtime polymorphism
Overloading is used to provide different ways of calling the same method with different parameters
Overriding is used to provide a specific implementation of a m...
Selenium components for automation testing
Selenium WebDriver - main component for browser automation
Selenium IDE - record and playback tool for creating test cases
Selenium Grid - distribute tests across multiple machines
Selenium RC - deprecated component for browser automation
Selenium Server - used to run Selenium tests on remote machines
posted on 16 Jul 2021
I applied via Company Website and was interviewed in Jan 2021. There was 1 interview round.
I applied via Naukri.com and was interviewed in Sep 2024. There was 1 interview round.
The output of the code will be 'animal is created' followed by 'Dog is created'.
The code defines a class Animal with a constructor that prints 'animal is created'.
It also defines a class Dog that extends Animal, with a constructor that prints 'Dog is created'.
In the main method, an instance of Dog is created, which will trigger the constructors of both Animal and Dog classes.
The output will be 'HelloThere'
Concatenation of 'Hello' and 'There' results in 'HelloThere'
The final string is printed using System.out.println()
The code creates a StringBuffer object with 'Hello' and appends 'There' to it before printing the final string.
StringBuffer is mutable, so the original 'Hello' string can be modified
The append() method adds the specified string to the end of the buffer
The final output will be 'HelloThere'
Option a is valid, option b is valid, option c is invalid.
Option a is valid because ChromeDriver is a subclass of WebDriver, so it can be assigned to a WebDriver reference.
Option b is valid because ChromeDriver is a subclass of WebDriver, so it can be instantiated using a WebDriver reference.
Option c is invalid because WebDriver is an interface and cannot be instantiated directly. It can only be used as a reference typ
Sort input array of strings in descending order without using inbuilt functions
Iterate through the array and compare each element with the rest to find the largest element
Swap the largest element with the first element, then repeat the process for the remaining elements
Continue this process until the array is sorted in descending order
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 locator provided
findElements returns a list of WebElements matching the locator provided
findElement will throw NoSuchElementException if no element is found, while findElements will return an empty list
getwindowhandle returns the handle of the current window, getwindowhandles() returns handles of all open windows
getwindowhandle returns a single window handle, while getwindowhandles() returns a set of window handles
getwindowhandle is used to switch between windows in Selenium WebDriver
Output type of getwindowhandle is String, while output type of getwindowhandles() is Set
String is immutable, while StringBuilder is mutable and more efficient for concatenating strings.
String is immutable, meaning its value cannot be changed once it is created.
StringBuilder is mutable, allowing for modifications to the string without creating a new object.
StringBuilder is more efficient for concatenating multiple strings as it does not create new objects each time.
Example: String str = "Hello"; StringBuil
I applied via Company Website and was interviewed in Oct 2024. There was 1 interview round.
Java program to print sum of digits from a given string
Iterate through each character in the string
Check if the character is a digit using Character.isDigit() method
Convert the digit character to integer using Character.getNumericValue() method
Sum up all the digits found in the string
OOPs concepts used in the framework include inheritance, polymorphism, encapsulation, and abstraction.
Inheritance is used to create a parent-child relationship between classes. For example, a base class 'Page' can be inherited by 'HomePage' and 'LoginPage' classes.
Polymorphism allows objects of different classes to be treated as objects of a common superclass. For instance, a 'click' method can be implemented different...
Polymorphism is the ability of a single function or method to operate on different types of data.
Polymorphism allows objects of different classes to be treated as objects of a common superclass.
There are two types of polymorphism: compile-time (method overloading) and runtime (method overriding).
Example of compile-time polymorphism: function overloading in Java.
Example of runtime polymorphism: method overriding in Java
Java program to print the sum of elements in a string array.
Convert each element in the string array to an integer using Integer.parseInt()
Sum up all the integers to get the total sum
I was interviewed in May 2024.
Gherkin words are keywords used in Gherkin syntax for writing test scenarios in Behavior Driven Development (BDD).
Feature
Scenario
Given
When
Then
And
But
Plugins are used to extend the functionality of a software application.
Plugins are additional software components that can be added to an existing application to provide new features or functionalities.
They can be used to customize the behavior of the application without modifying its core code.
Examples of plugins include browser extensions, WordPress plugins, and Adobe Photoshop filters.
To run a runner class, you can use a test runner tool like JUnit or TestNG in your automation testing framework.
Use a test runner tool like JUnit or TestNG to execute the runner class
Add the @RunWith annotation in JUnit or specify the runner class in TestNG XML file
Make sure the runner class includes the necessary setup and teardown methods for test execution
TestNG allows running tests in parallel mode using groups and priorities.
Use 'parallel' attribute in testng.xml file to specify parallel mode (e.g.
Use 'groups' attribute in testng.xml file to group tests that should run in parallel (e.g.
Use 'priority' attribute in testng.xml file to specify the order in which tests should run (e.g.
Merge Sort is a divide and conquer algorithm that divides the input array into two halves, sorts them, and then merges them back together.
Divide the array into two halves recursively
Sort each half using Merge Sort recursively
Merge the sorted halves back together
Program to reverse a string using array of characters
Create an array of characters from the input string
Iterate through the array in reverse order and append each character to a new string
Return the reversed string
Data driven testing syntax using XSSF Workbook
Create XSSFWorkbook object
Get the sheet from the workbook
Iterate through rows and columns to fetch test data
Use test data in your test cases
posted on 24 Oct 2024
I applied via LinkedIn and was interviewed in Sep 2024. There was 1 interview round.
Hard assert is a type of assertion in test automation that stops the test execution immediately when a failure occurs.
Hard assert is used to validate the expected outcome of a test case
If the assertion fails, the test execution is halted and marked as failed
It is commonly used in automated test scripts to ensure the correctness of the application under test
Soft assert is a way to continue the execution of a test case even after an assertion failure.
Soft assert does not stop the execution of the test case when an assertion fails.
It is useful when you want to log the failure but continue with the remaining test steps.
Soft assert is commonly used in test automation frameworks like TestNG in Java.
based on 3 reviews
Rating in categories
Associate
72.5k
salaries
| ₹5.1 L/yr - ₹15.9 L/yr |
Programmer Analyst
55.4k
salaries
| ₹2.4 L/yr - ₹9.7 L/yr |
Senior Associate
48.3k
salaries
| ₹9 L/yr - ₹27 L/yr |
Senior Processing Executive
28.5k
salaries
| ₹1.8 L/yr - ₹9 L/yr |
Technical Lead
17.6k
salaries
| ₹5.9 L/yr - ₹24 L/yr |
TCS
Infosys
Wipro
Accenture