Capgemini
10+ Peacock Engineering Interview Questions and Answers
Q1. Wait in selenium and exception in selenium
Explanation of wait and exception handling in Selenium
Wait in Selenium is used to pause the execution of the script for a certain amount of time
There are two types of waits: Implicit and Explicit
Exception handling in Selenium is used to handle unexpected errors during the execution of the script
Common exceptions in Selenium include NoSuchElementException and TimeoutException
Handling exceptions can be done using try-catch blocks or by using TestNG annotations
Q2. What is throw and throws in Java?
throw is used to throw an exception in Java, while throws is used to declare exceptions that a method can throw.
throw is used to explicitly throw an exception in Java code
throws is used in method signature to declare the exceptions that the method can throw
Example: throw new Exception("Something went wrong!");
Example: public void someMethod() throws IOException {}
Q3. Real time process with selenium examples
Real-time process with Selenium involves continuous monitoring and updating of web pages.
Use implicit and explicit waits to ensure real-time updates
Implement continuous integration and delivery to automate testing
Use Selenium Grid to run tests in parallel for faster execution
Examples include monitoring stock prices, social media feeds, and live sports scores
Q4. Difference between @BeforeMethod vs @BeforeTest
The @BeforeMethod annotation is used to run a method before each test method in a class, while @BeforeTest is used to run a method before any test method in a test tag.
The @BeforeMethod annotation is specific to TestNG framework and is used to initialize test data before each test method.
@BeforeTest annotation is also specific to TestNG and is used to initialize test data before any test method in a test tag.
If a class has multiple test methods, @BeforeMethod will run before ...read more
Q5. Array based program: reverse the string
Reverse a string using an array of characters.
Create an array of characters to store the string.
Iterate through the string and store each character in the array.
Reverse the array of characters to get the reversed string.
Q6. What is automation testing
Automation testing is the use of software tools to execute tests and compare actual outcomes with expected outcomes.
Automation testing involves writing scripts or using tools to automate repetitive tasks in testing.
It helps in reducing human errors and increasing efficiency.
It can be used for various types of testing such as functional, regression, performance, and load testing.
Examples of automation testing tools include Selenium, Appium, and JUnit.
Q7. Oops concepts in Java
Oops concepts are fundamental to Java programming and include inheritance, polymorphism, encapsulation, and abstraction.
Inheritance allows a class to inherit properties and methods from a parent class.
Polymorphism allows objects to take on multiple forms and behave differently based on their context.
Encapsulation hides the implementation details of a class and only exposes necessary information.
Abstraction allows for the creation of abstract classes and interfaces that can be...read more
Q8. Why testng was used
TestNG was used for automated testing in order to facilitate easy test case management, parallel execution, and reporting.
TestNG allows for easy grouping and prioritization of test cases.
It supports parallel execution of test cases, improving efficiency.
TestNG provides detailed test reports, making it easier to identify and debug issues.
Annotations in TestNG help in defining the test methods and their dependencies.
TestNG integrates well with other tools and frameworks like Se...read more
Q9. String Buffer VS Builder
String Buffer is synchronized and slower, while StringBuilder is unsynchronized and faster.
StringBuffer is thread-safe, while StringBuilder is not.
StringBuffer is slower due to synchronization, while StringBuilder is faster.
StringBuilder is preferred for single-threaded environments.
StringBuffer is preferred for multi-threaded environments.
Both classes are used for manipulating strings, but StringBuilder is more efficient.
Q10. explain the framework
A framework is a set of guidelines, coding standards, concepts, and practices to help automate testing efficiently.
Framework provides a structure for organizing test scripts, data, and reusable components.
It helps in maintaining consistency and reusability of test scripts.
Frameworks can be data-driven, keyword-driven, or hybrid depending on the requirements.
Examples of frameworks include Selenium WebDriver, TestNG, JUnit, etc.
More about working at Capgemini
Interview Process at Peacock Engineering
Top Automation Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month