Cognizant
GuruBasava CBSE English Medium School Interview Questions and Answers
Q1. Where you use map and set in project?
Map and set are used in projects for efficient data storage and retrieval.
Map is used to store key-value pairs, allowing quick access to values based on their keys.
Set is used to store unique values, ensuring that each value is only stored once.
Map and set are commonly used in data processing, caching, and indexing operations.
Example: In a project, a map can be used to store user preferences with keys representing the preference names and values representing the corresponding...read more
Q2. Tell me different exception?
Different types of exceptions in software testing
ArithmeticException - occurs when an arithmetic operation fails
NullPointerException - occurs when a null reference is used
ArrayIndexOutOfBoundsException - occurs when accessing an array with an invalid index
FileNotFoundException - occurs when a required file is not found
TimeoutException - occurs when an operation exceeds the specified time limit
Q3. Sequence of testng annotations?
The sequence of TestNG annotations is @BeforeSuite, @BeforeTest, @BeforeClass, @BeforeMethod, @Test, @AfterMethod, @AfterClass, @AfterTest, @AfterSuite.
@BeforeSuite - Executed before the test suite starts.
@BeforeTest - Executed before each test tag in the testng.xml file.
@BeforeClass - Executed before the first test method in the current class.
@BeforeMethod - Executed before each test method.
@Test - Represents a test method.
@AfterMethod - Executed after each test method.
@Afte...read more
Q4. Explain more about xpath css?
XPath and CSS are both locator strategies used in web testing to identify elements on a webpage.
XPath is a language used to navigate XML documents and is commonly used in web testing to locate elements based on their attributes or structure.
CSS selectors are used to select elements based on their attributes, classes, or IDs.
XPath is more powerful and flexible than CSS selectors, but can be slower.
CSS selectors are generally faster and easier to read and write.
XPath can traver...read more
Q5. Challenge faced in automatiio?
One challenge faced in automation is handling dynamic elements on web pages.
Identifying and handling dynamic elements that change their attributes or positions on the page.
Using techniques like wait conditions, dynamic locators, or regular expressions to handle dynamic elements.
Ensuring the stability and reliability of automated tests when dealing with dynamic elements.
Adapting automation scripts to handle changes in dynamic elements without breaking the tests.
Regularly updat...read more
Q6. Different locators?
Different locators are used in software testing to identify and interact with elements on a web page or application.
XPath: Uses path expressions to navigate through elements in an XML document
CSS Selector: Selects elements based on their attributes, classes, or IDs
ID: Locates elements by their unique identifier
Name: Finds elements by their name attribute
Class Name: Identifies elements by their class attribute
Tag Name: Locates elements by their HTML tag name
Link Text: Finds el...read more
More about working at Cognizant
Reviews
Interviews
Salaries
Users/Month