Automation Test Engineer
60+ Automation Test Engineer Interview Questions and Answers for Freshers
Q1. Introduce yourself 1.What is STLC 2. difference between Test plan,test case,test scanario 3.Positive and negative scanarion on pen. 4.selenium framework. 5.how to write selenium test cases.
I am an Automation Test Engineer with knowledge of STLC, test plan, test case, test scenario, Selenium framework, and writing Selenium test cases.
STLC stands for Software Testing Life Cycle and is a process followed to ensure quality in software testing.
Test plan is a document that outlines the testing strategy, objectives, and scope of testing.
Test case is a set of steps and conditions that are executed to verify the functionality of a software application.
Test scenario is a...read more
Q2. 1.types of wait, 2. Locators in selenium 3.grid vs webdriver 4.css selector vs xpath 5.types of list 6. What is use of action class 7.java script executor 8.interfaces 9.oops concepts 10.windows/alert nagivatio...
read moreInterview questions for Automation Test Engineer
Types of wait - implicit, explicit, fluent
Locators in Selenium - ID, Name, Class Name, Tag Name, Link Text, Partial Link Text, CSS Selector, XPath
Grid vs WebDriver - Grid allows parallel execution on multiple machines, WebDriver executes tests on a single machine
CSS Selector vs XPath - CSS Selector is faster, XPath is more powerful
Types of list - ArrayList, LinkedList, Vector
Use of Action Class - performing advanced user interac...read more
Q3. 1.Difference Between Const,Var,Char. 2.Oop's concept with example 3.JavaScript is async or sync language and explain the reason. 4.How to create a simple object in JavaScript. 5.Find element and Find Elements d...
read moreAnswers to common interview questions for Automation Test Engineer position.
Const is used for constant values that cannot be reassigned, var is used for variable declaration, and char is a data type for storing characters in programming languages.
OOPs concepts include inheritance, encapsulation, polymorphism, and abstraction. Example: Inheritance allows a class to inherit properties and methods from another class.
JavaScript is an asynchronous language, meaning it can execute ...read more
Q4. what is selenium grid?, what frame work u use, explain?, what is web driver ?methods ,What is your daily activity ? Asked to write a mail to a client addressing about task completed .
Selenium grid is a tool used for parallel execution of test cases on multiple machines. WebDriver is a tool for automating web applications.
Selenium grid allows for distributed testing across multiple machines and browsers
WebDriver is a tool for automating web applications and supports multiple programming languages
Daily activities include writing and executing test cases, debugging issues, and reporting results
Framework used depends on project requirements and can vary from ...read more
Q5. What are the challenges in selenium
Challenges in Selenium include browser compatibility, dynamic elements, and test maintenance.
Browser compatibility issues can arise due to differences in browser versions and configurations.
Dynamic elements can cause tests to fail if not handled properly.
Test maintenance can be challenging due to changes in the application under test.
Synchronization issues can occur when the test script runs faster than the application.
Handling pop-ups and alerts can be tricky.
Cross-domain te...read more
Q6. Login with multiple credentials which are stored in one excel sheet
Multiple credentials can be logged in using data from an excel sheet.
Read the excel sheet using a library like Apache POI
Iterate through the rows and columns to get the data
Use a loop to login with each set of credentials
Assert the login success or failure for each set of credentials
Share interview questions and help millions of jobseekers 🌟
Q7. What is the process for reading from or writing to a file in Java? Please provide a sample code snippet for writing to a file.
Java provides various classes for file handling, allowing reading and writing operations using streams.
Use FileWriter for writing text files: FileWriter writer = new FileWriter('file.txt');
Use BufferedWriter for efficient writing: BufferedWriter bufferedWriter = new BufferedWriter(writer);
Always close the writer using bufferedWriter.close() to free resources.
Handle exceptions using try-catch blocks to manage IOExceptions.
Q8. 3) Different methods to identify an object using eggplant
Different methods to identify an object using eggplant
Using text recognition
Using image recognition
Using coordinates
Using attributes
Using tags
Automation Test Engineer Jobs
Q9. What is the process for creating a collection from a given string?
Creating a collection from a string involves splitting the string into elements and storing them in a data structure.
Use the split() method to divide the string into an array. Example: 'a,b,c'.split(',') results in ['a', 'b', 'c'].
Choose a collection type based on requirements: Array, List, Set, etc.
For unique elements, consider using a Set. Example: new Set('aabb') results in ['a', 'b'].
If order matters, use an Array or List. Example: ['apple', 'banana', 'cherry'] maintains ...read more
Q10. How do you want to transition from manual to automation test
I would start by identifying the most repetitive and time-consuming manual tests and prioritize them for automation.
Identify the most repetitive and time-consuming manual tests
Prioritize the tests based on their importance and frequency
Select the appropriate automation tool and framework
Create test scripts and automate the identified tests
Execute the automated tests and analyze the results
Gradually increase the automation coverage and reduce manual testing
Q11. 1)Program to read/write data using eggplant
Eggplant can read/write data using its built-in scripting language SenseTalk.
Use the 'put' command to write data to a file or variable.
Use the 'read' command to read data from a file or variable.
Eggplant also supports reading/writing data to databases and spreadsheets.
Example: put "Hello World" into myVariable; read myVariable
Example: put "123" into file "myFile.txt"; read file "myFile.txt"
Q12. How can you read inputs from command line arguments and execute functions based on those inputs?
Read command line arguments in Python to execute functions based on user input.
Use the 'sys' module to access command line arguments: `import sys`.
Access arguments via `sys.argv`, which is a list of command line inputs.
Example: `sys.argv[0]` is the script name, `sys.argv[1]` is the first argument.
Define functions and use conditional statements to execute based on input.
Example: `if sys.argv[1] == 'test': run_test_function()`.
Q13. What would be the sample process for creating an automation that can persist after a system restart?
Creating persistent automation involves ensuring scripts run after system restarts using services or scheduled tasks.
Use a service manager (e.g., systemd on Linux) to run automation scripts on startup.
Create a scheduled task in Windows Task Scheduler to trigger automation scripts after reboot.
Implement a watchdog mechanism to restart automation if it fails unexpectedly.
Store automation state in a database or file to resume from the last checkpoint after a restart.
Utilize cont...read more
Q14. How to identify object in Selenium
To identify objects in Selenium, we use locators such as ID, Name, Class Name, XPath, CSS Selector, etc.
Locators are used to identify web elements on a page
ID and Name are the most commonly used locators
XPath and CSS Selector are more powerful but slower
Class Name is useful for identifying multiple elements with the same class
Locators can be used with findElement() and findElements() methods
Example: driver.findElement(By.id("username"));
Q15. Is it possible to create a private constructor in a Java class?
Q16. what is feature and step definitions in cucumber BDD
Feature files contain high-level description of the functionality to be tested, while step definitions are the implementation of the steps in the feature file using code.
Feature files are written in Gherkin syntax and describe the behavior of the application in plain text.
Step definitions are written in programming languages like Java, Ruby, etc., and map the steps in the feature file to automation code.
Feature files and step definitions together form the basis of Behavior Dr...read more
Q17. What is Inheritance? Polymorphism?
Inheritance is a mechanism in object-oriented programming where a class inherits properties and behaviors from another class. Polymorphism allows objects of different classes to be treated as objects of a common superclass.
Inheritance allows for code reusability by defining a new class based on an existing class.
Polymorphism enables flexibility in programming by allowing objects to be treated as instances of their parent class.
Example of inheritance: Class B inheriting from C...read more
Q18. What is the alternative for the @Test annotation in Playwright?
In Playwright, the alternative for @Test annotation is using the test function from the Playwright Test framework.
Playwright uses the 'test' function to define test cases, similar to @Test in other frameworks.
Example: 'test('should load the homepage', async () => { ... });'
You can group tests using 'describe' blocks: 'describe('Homepage tests', () => { ... });'
Playwright supports various assertions through the 'expect' function, e.g., 'expect(page).toHaveTitle('Home');'
Q19. What is the process for implementing assertions in Playwright?
Assertions in Playwright validate expected outcomes in automated tests, ensuring application behavior meets requirements.
Use 'expect' from Playwright's test library to create assertions.
Example: expect(page.title()).toBe('Expected Title');
Assertions can check various conditions like visibility, text content, and element states.
Example: expect(await page.isVisible('selector')).toBe(true);
Assertions can be chained for more complex validations.
Example: expect(element).toHaveText...read more
Q20. Selenium waits and different locators and exception handling with alert and frame concepts with TestNG too
The question is about Selenium waits, locators, exception handling, alerts, frames, and TestNG.
Selenium waits are used to synchronize the test script with the application under test
Locators are used to identify web elements on a web page
Exception handling is used to handle errors and exceptions that occur during test execution
Alerts are used to handle pop-up windows that appear during test execution
Frames are used to handle web pages that contain multiple frames
TestNG is a te...read more
Q21. In API testing in postman when do we get 408 status
A 408 status in API testing in Postman is received when the server times out while waiting for a request.
408 status code indicates that the server did not receive a complete request within the time that it was prepared to wait.
This can happen if the client takes too long to send the request or if the server is overloaded.
It is important to adjust timeout settings in Postman to avoid receiving 408 status codes.
Example: If the server expects a request to be completed within 10 ...read more
Q22. Tell all webdriver exceptions
List of common WebDriver exceptions
NoSuchElementException - When an element is not found in the DOM
TimeoutException - When a command takes too long to complete
StaleElementReferenceException - When an element is no longer attached to the DOM
ElementNotVisibleException - When an element is present in the DOM but not visible
ElementNotInteractableException - When an element is present in the DOM but not interactable
InvalidElementStateException - When an element is in an invalid st...read more
Q23. What is Test case, Test plan and Test Secenarios
Test case is a set of conditions or variables under which a tester will determine whether a system under test satisfies requirements. Test plan is a document outlining the scope, approach, resources, and schedule of testing activities. Test scenarios are detailed descriptions of possible interactions with the system.
Test case: specific conditions to be tested, expected results, steps to execute
Test plan: overall strategy for testing, including objectives, resources, schedule
T...read more
Q24. What would be return if multiple tabs are open
The return would be the number of tabs open in the browser.
The return value would be an integer representing the count of open tabs.
For example, if there are 5 tabs open, the return value would be 5.
Q25. What is Type coercion?
Type coercion is the process of converting one data type to another in programming.
Type coercion can happen implicitly or explicitly in programming languages.
Implicit type coercion occurs when the language automatically converts data types during operations.
Explicit type coercion occurs when the programmer manually converts data types using functions or operators.
Example: In JavaScript, the addition operator (+) can perform implicit type coercion by converting a number to a s...read more
Q26. write the code in notepad by sharing your screen
Code writing task for Automation Test Engineer position
Open Notepad
Write code for the given task
Share screen to show the code
Ensure code is well-structured and follows best practices
Q27. How does end to end testing works?
End to end testing is a methodology to test the entire system flow from start to finish.
It involves testing all the components of the system together
It ensures that the system is working as expected in real-world scenarios
It helps identify any issues or bottlenecks in the system flow
Examples include testing an e-commerce website from browsing to checkout
Automated tools can be used to perform end to end testing
Q28. WAP for reverse string. array vs arraylist. map and hashmap. what are the explicit wait expected conditions. how to perform mouse over on webelement.
This question covers topics like reversing a string, array vs ArrayList, map and HashMap, explicit wait expected conditions, and performing mouse over on a WebElement.
To reverse a string, you can use the StringBuilder class and its reverse() method.
An array is a fixed-size data structure, while an ArrayList is a dynamic-size data structure.
Map is an interface that represents a mapping between a key and a value, while HashMap is an implementation of the Map interface.
Explicit ...read more
Q29. Can a class be declared as private in Java?
In Java, a top-level class cannot be declared private; only nested classes can be private.
Top-level classes can be public, protected, or package-private, but not private.
Private classes can only be nested within another class.
Example of a private nested class: class Outer { private class Inner {} }
Private classes are used to encapsulate functionality within a specific context.
Q30. How to take screenshot when a test case is failed
Use Selenium WebDriver to capture screenshot on test case failure
Use Selenium WebDriver's getScreenshotAs method to capture screenshot
Save the screenshot to a specified location on the system
Include the screenshot capture code in the test case failure handling logic
Q31. What is linkedlist in java?? It is part object to address.
A linked list in Java is a data structure that consists of a sequence of elements where each element points to the next element in the sequence.
Each element in a linked list is called a node.
Nodes in a linked list are connected through pointers or references.
Linked lists can be singly linked (each node points to the next node) or doubly linked (each node points to both the next and previous nodes).
Example: LinkedList<Integer> list = new LinkedList<Integer>();
Q32. API Error code with explaination?
API error codes are unique identifiers used to indicate specific errors in an API response.
API error codes are typically numeric or alphanumeric codes that correspond to specific errors in the API.
Each error code should have a corresponding explanation in the API documentation to help developers understand the issue.
Examples of API error codes include 400 Bad Request, 401 Unauthorized, and 404 Not Found.
Q33. Write a program to find character occurances in "Hello World"
Program to find character occurances in 'Hello World'
Create a map to store character occurrences
Iterate through each character in the string and update the map
Print the character occurrences from the map
Q34. Challenges faced during commit code in Version control
Challenges include conflicts with other developers' changes, incorrect file paths, and forgetting to add files.
Conflicts with other developers' changes
Incorrect file paths
Forgetting to add files
Q35. What are the annotations used in TestNG
TestNG annotations are used to control the flow of test methods and provide additional information about the test.
Annotations like @Test, @BeforeSuite, @AfterSuite are used to define test methods and setup/teardown methods
Annotations like @BeforeTest, @AfterTest are used to run setup/teardown methods before/after a test
Annotations like @BeforeClass, @AfterClass are used to run setup/teardown methods before/after a test class
Annotations like @BeforeMethod, @AfterMethod are use...read more
Q36. I hav explain ladder logic diagram
Ladder logic diagram is a graphical programming language used for PLC programming.
Ladder logic diagrams consist of rungs representing logical control circuits.
It uses symbols to represent different components like contacts, coils, timers, etc.
The logic flow is from left to right, with power flowing from top to bottom.
It is commonly used in Programmable Logic Controllers (PLCs) for automation.
Example: A simple ladder logic diagram for a motor control circuit.
Q37. relative xpath vs absolute xpath
Relative xpath is based on the current element's position, while absolute xpath starts from the root element.
Relative xpath is shorter and more flexible, as it can adapt to changes in the structure of the page.
Absolute xpath is longer and more specific, making it more prone to breaking if the page structure changes.
Relative xpath is preferred for automation testing as it is more robust and easier to maintain.
Absolute xpath is useful when the element's position is fixed and un...read more
Q38. Difference between absolute and relative Xpath
Absolute Xpath starts from the root element, while relative Xpath starts from any node in the DOM structure.
Absolute Xpath starts with a single forward slash (/) and starts selection from the root node.
Relative Xpath starts with a double forward slash (//) and starts selection from the current node or any node in the DOM structure.
Absolute Xpath is more brittle and prone to breaking if the structure of the page changes, while relative Xpath is more flexible and resilient to c...read more
Q39. 1. Explain opps concept. 2. Explain Overriding and Overloading.
OOPs is a programming paradigm based on the concept of objects, which can contain data and code.
OOPs stands for Object-Oriented Programming.
It focuses on creating objects that interact with each other to solve a problem.
In OOPs, data and code are encapsulated within objects.
Inheritance, Polymorphism, and Encapsulation are the three main pillars of OOPs.
Overriding is when a subclass provides its own implementation of a method that is already present in its parent class.
Overloa...read more
Q40. Difference between abstract and interface
Abstract class is a class that cannot be instantiated and can have both abstract and non-abstract methods. Interface is a blueprint for a class and can only have abstract methods.
Abstract class can have constructors while interface cannot
A class can implement multiple interfaces but can only inherit from one abstract class
Abstract class can have instance variables while interface cannot
Abstract class is used for code reusability while interface is used for achieving abstracti...read more
Q41. manual vs automation?
Automation testing is more efficient for repetitive tasks, while manual testing allows for more exploratory and creative testing.
Automation testing is ideal for repetitive tasks that require frequent execution.
Manual testing is better suited for exploratory testing and scenarios that require human intuition.
Automation can provide faster feedback and increased test coverage.
Manual testing allows for more creativity and adaptability in testing approaches.
A combination of both m...read more
Q42. How to input data in cucumber
Data can be input in Cucumber using feature files and step definitions.
Data can be input in feature files using scenarios and scenario outlines
Step definitions can be used to define the actions to be taken with the input data
Data tables can be used in feature files to input structured data
Examples keyword can be used in scenario outlines to provide multiple sets of input data
Q43. What are the waits in selenium
Types of waits in Selenium include Implicit Wait, Explicit Wait, and Fluent Wait.
Implicit Wait: Waits for a certain amount of time before throwing a NoSuchElementException.
Explicit Wait: Waits for a certain condition to occur before proceeding further in the code.
Fluent Wait: Waits for a condition to be true with a defined polling frequency.
Example: driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
Q44. Code on string manipulation
String manipulation code
Use string methods like split(), replace(), substring() etc.
Loop through the string to manipulate each character
Regular expressions can also be used for complex manipulations
Q45. waterfall vs agile models
Waterfall model is a linear sequential approach, while Agile model is iterative and incremental.
Waterfall model follows a sequential process, where each phase must be completed before moving on to the next.
Agile model breaks the project into small iterations, allowing for flexibility and continuous feedback.
Waterfall model is best suited for projects with well-defined requirements, while Agile is ideal for projects with evolving requirements.
Waterfall model has less flexibili...read more
Q46. explain your automation framework
My automation framework is a hybrid framework that uses both data-driven and keyword-driven approaches.
The framework is built using Selenium WebDriver and TestNG.
It uses Excel sheets to store test data and Apache POI library to read/write data from/to Excel.
The framework has a modular structure with reusable functions and libraries.
It uses Page Object Model design pattern to maintain object repository.
The framework generates detailed HTML reports using ExtentReports library.
I...read more
Q47. Tell about multi node architecture
Multi node architecture refers to a system where multiple nodes work together to perform tasks and share resources.
Involves multiple nodes connected to a central server or each other
Allows for distributed computing and load balancing
Common in cloud computing and big data applications
Q48. What is multithreading
Multithreading is the ability of a CPU to execute multiple threads concurrently, allowing for better performance and resource utilization.
Multithreading allows multiple threads to run concurrently within the same process.
Each thread has its own stack and shares the same memory space.
Multithreading can improve performance by utilizing multiple CPU cores efficiently.
Examples of multithreading include running multiple tasks simultaneously in a web server or processing data in pa...read more
Q49. Count character occurance in a String
Count character occurance in a String
Iterate through the string and use a HashMap to store character counts
Handle both uppercase and lowercase characters separately
Consider using a character array to count occurrences for better performance
Q50. Locators in selenium
Locators in Selenium are used to identify web elements on a webpage for automation testing purposes.
Locators can be used to find elements by ID, class name, name, tag name, link text, partial link text, CSS selector, or XPath.
Using unique locators is important to ensure stable and reliable test automation scripts.
Examples of locators include driver.findElement(By.id("elementID")), driver.findElement(By.className("elementClass")), and driver.findElement(By.xpath("//xpathExpres...read more
Interview Questions of Similar Designations
Top Interview Questions for Automation Test Engineer Related Skills
Interview experiences of popular companies
Calculate your in-hand salary
Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary
Reviews
Interviews
Salaries
Users/Month