Cognizant
10+ Kody Equipments Interview Questions and Answers
Q1. What is the different get and quit methods?
The get method is used to retrieve a value from a data structure, while the quit method is used to terminate a program or session.
The get method is commonly used in programming languages to access elements from arrays, lists, dictionaries, etc.
The quit method is typically used to gracefully exit a program or session, closing any open resources or connections.
Example: In Python, the get method is used to retrieve values from dictionaries, while the quit method is used to exit ...read more
Q2. How to skip a specific test case in TestNG?
How to skip a specific test case in TestNG?
Use @Test(enabled = false) annotation to skip a test case
Use @Test(groups = {"skip"}) annotation and exclude the group from test execution
Use ITestResult.SKIP status to skip a test case programmatically
Q3. Explain the exception handling process in your project?
Exception handling process involves identifying, catching, and handling errors in the software.
Identify potential exceptions and define exception classes
Catch exceptions using try-catch blocks
Handle exceptions appropriately, either by logging or displaying error messages
Implement a fallback mechanism to handle unexpected exceptions
Test exception handling scenarios thoroughly
Q4. Explain the order of TestNG annotations execution flow?
TestNG annotations are executed in a specific order to ensure proper test execution.
BeforeSuite
BeforeTest
BeforeClass
BeforeMethod
Test
AfterMethod
AfterClass
AfterTest
AfterSuite
Q5. Difference between absolute Xpath and relative Xpath?
Absolute Xpath is the complete path from the root element while relative Xpath is the path from the current element.
Absolute Xpath starts with a single forward slash (/) and is used to locate an element from the root node.
Relative Xpath starts with a double forward slash (//) and is used to locate an element from the current node.
Absolute Xpath is more specific and less flexible while relative Xpath is more flexible and less specific.
Example of Absolute Xpath: /html/body/div[...read more
Q6. Difference between scenario & scenario outline?
Scenario outlines are templates for scenarios with placeholders for input values.
Scenario outlines are used in BDD frameworks like Cucumber.
They allow for the creation of multiple scenarios with different input values.
Scenario outlines use placeholders like
to represent input values. Example: Given a
with , when they log in, then they should see the . Scenario outlines are more flexible and reusable than regular scenarios.
Q7. Explain execution flow of cucumber framework?
Cucumber framework executes feature files using step definitions and generates reports.
Cucumber reads feature files written in Gherkin syntax
Step definitions are written in programming language
Cucumber matches steps in feature file with step definitions
Cucumber generates reports after execution
Q8. How to select check box in selenium?
To select a checkbox in Selenium, locate the checkbox element and use the 'click' method.
Locate the checkbox element using any of the available locators in Selenium
Use the 'click' method to select the checkbox
Verify that the checkbox is selected using the 'isSelected' method
Q9. Difference between Overloading & Overriding?
Overloading is having multiple methods with the same name but different parameters. Overriding is having a method in a subclass with the same name and parameters as a method in its superclass.
Overloading is compile-time polymorphism while overriding is runtime polymorphism.
Overloading is used to provide different implementations of the same method for different input parameters.
Overriding is used to provide a specific implementation of a method that is already provided by its...read more
Q10. Explain TakescreenShot sudo code?
TakescreenShot sudo code captures the screen and saves it as an image file.
Import necessary libraries for capturing the screen and saving images
Define a function to capture the screen
Specify the file format and location to save the screenshot
Call the function to capture and save the screenshot
More about working at Cognizant
Reviews
Interviews
Salaries
Users/Month