Cognizant
10+ Laser Experts Interview Questions and Answers
Q1. reverse string, find duplicate character in a string
Reverse a string and find duplicate characters in it.
Use built-in functions like reverse() and count() in Python.
Loop through the string and compare each character with the rest of the string to find duplicates.
Create a dictionary to store the count of each character and return the duplicates.
Convert the string to an array, reverse it, and join it back to get the reversed string.
Q2. How to identify an dynamically changing object
Dynamically changing objects can be identified by using unique attributes like ID, class, or XPath.
Inspect the object in the DOM to find unique identifiers like ID, class, or XPath
Use tools like Chrome Developer Tools or Firebug to identify dynamic changes
Monitor changes in the object's attributes or properties during automation testing
Q3. how to fetch data from xls
To fetch data from xls, use a library like Apache POI or OpenPyXL.
Use a library like Apache POI or OpenPyXL to read data from xls files
Identify the sheet and cell range to read data from
Iterate through the rows and columns to extract the data
Handle any formatting or data type conversions as needed
Q4. Wait in Selenium. type of waits.
Types of waits in Selenium include implicit, explicit, and fluent waits.
Implicit waits wait for a certain amount of time before throwing an exception if an element is not found.
Explicit waits wait for a certain condition to be met before proceeding with the next step.
Fluent waits wait for a certain condition to be met within a specified time frame.
Examples of conditions include element visibility, element clickability, and text presence.
Examples of time frames include seconds...read more
Q5. What is your experience in Automation?
I have 3 years of experience in Automation testing using tools like Selenium and Appium.
Developed automated test scripts for web applications using Selenium WebDriver
Performed mobile automation testing using Appium for iOS and Android applications
Integrated automation scripts with continuous integration tools like Jenkins
Q6. dynamic element how to search
Dynamic elements can be searched using unique attributes like ID, class, name, or XPath.
Use ID attribute if it's unique and static
Use class attribute if it's unique and dynamic
Use name attribute if it's unique and static
Use XPath if other attributes are not unique or not available
Q7. framework used in your previous project
We used Selenium WebDriver with TestNG framework for automated testing in our previous project.
Selenium WebDriver was used for automating web application testing
TestNG framework was used for test case management and execution
Integration with Jenkins for continuous integration
Page Object Model design pattern was implemented for better test maintenance
Q8. How to remove duplicate data
To remove duplicate data, use data structures like sets or hashmaps to store unique values.
Use a set to store unique values and then convert it back to an array
Iterate through the array and check if the value already exists in the set before adding it
Use a hashmap to store values as keys and their occurrences as values, then filter out values with occurrences greater than 1
Q9. How to identify a table
A table can be identified by its structure, typically consisting of rows and columns.
Look for a grid-like structure with rows and columns
Check for headings or labels for each column
Tables often contain data organized in a structured format
Q10. Types of selectors
Selectors are used in automation testing to locate web elements on a page.
Types of selectors include ID, class, name, tag name, link text, partial link text, xpath, and css selector.
ID selector: #elementId
Class selector: .className
Name selector: [name='elementName']
Tag name selector: tagName
Link text selector: link=exactLinkText
Partial link text selector: partialLink=partialLinkText
XPath selector: //xpathExpression
CSS selector: css=cssSelector
More about working at Cognizant
Interview Process at Laser Experts
Top QA Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month