Sdet Automation Test Engineer

100+ Sdet Automation Test Engineer Interview Questions and Answers

Updated 8 Jan 2025
search-icon

Q1. Wait in selenium and how to find all links present in a page xpath

Ans.

To wait in Selenium, we can use explicit and implicit waits. To find all links in a page using XPath, we can use the findElements() method.

  • To wait in Selenium, we can use explicit wait with ExpectedConditions or implicit wait with the setScriptTimeout() method.

  • Explicit wait waits for a certain condition to occur before proceeding with the next steps.

  • Implicit wait sets a maximum time for the driver to wait for an element to appear.

  • To find all links in a page using XPath, we ca...read more

Q2. What is page object model and test ng annotations

Ans.

Page Object Model (POM) is a design pattern used in test automation to create an object repository for web UI elements.

  • POM helps in creating reusable and maintainable code by separating the test logic from the page-specific details.

  • Each web page is represented as a separate class, and the UI elements and their actions are defined as methods within that class.

  • POM improves code readability, reduces code duplication, and enhances test maintenance.

  • TestNG annotations are used in T...read more

Sdet Automation Test Engineer Interview Questions and Answers for Freshers

illustration image

Q3. How to handle alert in selenium and methods

Ans.

To handle alerts in Selenium, we use the Alert interface and its methods.

  • To switch to an alert, we use the switchTo() method of WebDriver class.

  • To accept or dismiss an alert, we use the accept() or dismiss() method of Alert interface.

  • To get the text of an alert, we use the getText() method of Alert interface.

  • To send text to an alert, we use the sendKeys() method of Alert interface.

Q4. How to take screenshot and project framework

Ans.

To take a screenshot in automation testing, use the built-in methods provided by the testing framework.

  • In Selenium, use the getScreenshotAs() method to capture a screenshot.

  • In Appium, use the getScreenshotAs() method to capture a screenshot.

  • In TestNG, use the ITestResult interface to capture a screenshot on test failure.

  • In Cucumber, use the After hook to capture a screenshot after each scenario.

Are these interview questions helpful?

Q5. What is software testing life cycle

Ans.

Software Testing Life Cycle (STLC) is a process followed to ensure quality in software development by conducting various testing activities.

  • STLC consists of several phases: requirement analysis, test planning, test case development, test environment setup, test execution, and test closure.

  • Each phase has specific objectives and deliverables, ensuring that the testing process is systematic and thorough.

  • STLC helps in identifying defects early, reducing the cost of fixing them, a...read more

Q6. How many locator is present in selenium

Ans.

There are 8 locators present in Selenium.

  • Selenium provides 8 different locators to identify elements on a web page.

  • The locators are: ID, Name, Class Name, Tag Name, Link Text, Partial Link Text, CSS Selector, and XPath.

  • Each locator has its own syntax and usage.

  • For example, to locate an element by ID, you can use driver.findElement(By.id("elementId"));

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q7. Maximum substring Sum , Merge two arrays without extra space .

Ans.

Find maximum sum of substring and merge two arrays without extra space.

  • Use Kadane's algorithm to find maximum sum of substring in an array.

  • To merge two arrays without extra space, use two pointers approach.

  • Example: Input arrays [1, 2, -3, 4, 5] and [6, 7, 8], output merged array [1, 2, -3, 4, 5, 6, 7, 8].

Q8. How to find broken link

Ans.

To find broken links, use a link checker tool or browser extension.

  • Use a link checker tool like Xenu's Link Sleuth or W3C Link Checker

  • Install a browser extension like Check My Links for Chrome or Link Checker for Firefox

  • Manually check links by clicking on them and checking for error messages

  • Regularly check for broken links to ensure website functionality

Sdet Automation Test Engineer Jobs

Sdet Automation Test Engineer 6-10 years
Cognizant
3.8
Hyderabad / Secunderabad
Sdet Automation Test Engineer 10-15 years
Quinnox
3.8
Mumbai
Sdet Automation Test Engineer 3-8 years
MSys Technologies
4.0
Pune

Q9. How to run your automated test case in jenkins and its configuration, How to automate DB testing, how do you perform localization testing

Ans.

To run automated test cases in Jenkins, configure DB testing, and perform localization testing

  • To run automated test cases in Jenkins, create a Jenkins job and configure it to trigger the automation test suite

  • For DB testing automation, use tools like Selenium WebDriver to interact with the database and verify data integrity

  • For localization testing, use tools like Selenium WebDriver to test the application with different languages and locales

  • Configure Jenkins to run the automat...read more

Q10. How are dynamic elements handled in Selenium

Ans.

Dynamic elements in Selenium are handled using techniques like explicit waits, fluent waits, and dynamic locators.

  • Use explicit waits to wait for a specific condition to be met before interacting with the element

  • Use fluent waits to wait for an element to be present and visible before interacting with it

  • Use dynamic locators like XPath with functions to locate elements that change dynamically

Q11. Can you write a program that outputs a sentence in reverse?

Ans.

Yes, I can write a program that outputs a sentence in reverse.

  • Create a function that takes a string as input

  • Split the string into an array of words

  • Reverse the array

  • Join the array back into a string and return

Q12. What are the different phases of the Software Testing Life Cycle (STLC)?

Ans.

STLC consists of phases like requirement analysis, test planning, test design, test execution, and test closure.

  • Requirement Analysis: Understanding the project requirements and defining the scope of testing.

  • Test Planning: Creating a test plan which includes test strategy, test objectives, and resource planning.

  • Test Design: Developing test cases and test scenarios based on requirements.

  • Test Execution: Running the test cases, reporting defects, and retesting.

  • Test Closure: Analy...read more

Q13. Explain framework ur working on, reverse string and swipe no. Without using third variable, method to check checkbox is selected,

Ans.

Answering questions on framework, string reversal, checkbox selection without third variable and swipe no.

  • Working on a hybrid framework with Selenium and Appium for web and mobile automation

  • String reversal can be done using built-in functions or by iterating through the string

  • Checkbox selection can be checked using isSelected() method in Selenium

  • Swipe no. can be achieved using TouchActions class in Appium

  • All of these can be implemented without using a third variable

Q14. 1 coding question Remove letter e from a sentence "Welcome to Ecom Express"

Ans.

Remove letter e from a sentence

  • Iterate through each character in the sentence

  • If the character is not 'e', add it to a new string

  • Return the new string without 'e'

Q15. If you have page with 10 records and verify if a record is deleted

Ans.

To verify if a record is deleted from a page with 10 records, we can check if the record is no longer displayed.

  • Locate the record on the page

  • Verify that the record is no longer visible

  • Confirm that the total number of records displayed is now 9

Q16. What is the difference between String Buffer and String builder calss

Ans.

String Buffer is synchronized and thread-safe, while String Builder is not synchronized and faster.

  • String Buffer is synchronized, making it thread-safe for use in multi-threaded environments.

  • String Builder is not synchronized, making it faster but not thread-safe.

  • String Buffer is slower than String Builder due to synchronization overhead.

  • Use String Buffer when thread safety is needed, and String Builder for better performance.

Q17. Agile methodologies and day to day operations

Ans.

Agile methodologies are integrated into day to day operations for efficient software development.

  • Agile methodologies promote collaboration and flexibility in development

  • Daily stand-up meetings keep the team updated on progress and any roadblocks

  • Sprints allow for focused development and frequent feedback

  • Continuous integration and testing ensure quality and catch issues early

  • Retrospectives provide opportunities for reflection and improvement

Q18. What is the difference between emulator and simulator

Ans.

Emulator replicates both hardware and software of the original device, while simulator only replicates the software.

  • Emulator replicates both hardware and software of the original device

  • Simulator only replicates the software

  • Emulator is slower but more accurate, simulator is faster but less accurate

  • Examples: Android Emulator for testing mobile apps, Flight Simulator for pilot training

Q19. what is interface in java an d explain OOPS concepts

Ans.

An interface in Java is a reference type, similar to a class, that can contain only constants, method signatures, default methods, static methods, and nested types.

  • Interfaces in Java are used to achieve abstraction and multiple inheritance.

  • Interfaces cannot have method bodies, only method signatures.

  • Classes can implement multiple interfaces, but can only extend one class.

  • Example: interface Shape { void draw(); }

  • Example: class Circle implements Shape { public void draw() { Sys...read more

Q20. What is method overloading and overridding?

Ans.

Method overloading is when multiple methods have the same name but different parameters, while method overriding is when a subclass provides a specific implementation of a method that is already provided by its superclass.

  • Method overloading involves creating multiple methods in the same class with the same name but different parameters.

  • Method overriding occurs when a subclass provides a specific implementation of a method that is already provided by its superclass.

  • Method over...read more

Q21. What is difference between abstract class and interface

Ans.

Abstract class can have both abstract and non-abstract methods, while interface can only have abstract methods.

  • Abstract class can have constructor, fields, and methods, while interface cannot have any implementation.

  • A class can implement multiple interfaces but can only inherit from one abstract class.

  • Abstract class is used to provide a common base for multiple derived classes, while interface is used to define a contract for classes to implement.

  • Example: Abstract class 'Shap...read more

Q22. Where you have applied OOPS concept in your automation framework

Ans.

I have applied OOPS concepts in my automation framework by creating reusable classes for different functionalities.

  • Used inheritance to create a base class with common methods for all test cases

  • Implemented polymorphism by overriding methods in child classes for specific test cases

  • Utilized encapsulation to hide the internal details of classes and expose only necessary methods and properties

Q23. Give an example of using Try Catch and Block in your framework

Ans.

Using Try Catch block in a framework for handling exceptions

  • Use Try block to enclose the code that might throw an exception

  • Use Catch block to handle the exception if it occurs

  • Use Finally block to execute code regardless of whether an exception was thrown or not

Q24. write java program to reverse the string/word

Ans.

Java program to reverse a string using StringBuilder

  • Create a StringBuilder object with the input string

  • Use the reverse() method of StringBuilder to reverse the string

  • Convert the StringBuilder object back to a string using toString() method

Q25. What is unit testing and who will be doing it?

Ans.

Unit testing is a software testing method where individual units or components of a software are tested in isolation.

  • Unit testing is typically done by developers to ensure that each unit of code functions correctly on its own.

  • It helps in identifying bugs early in the development process.

  • Unit tests are automated and focus on testing small, specific parts of the code.

  • Examples of unit testing frameworks include JUnit for Java, NUnit for .NET, and pytest for Python.

Q26. Explain Stale element exception and how to overcome that.

Ans.

Stale element exception occurs when an element is no longer attached to the DOM. It can be overcome by re-locating the element.

  • Stale element exception is a common issue in automation testing, especially in Selenium WebDriver.

  • It occurs when an element that was located on a web page becomes stale, meaning it is no longer attached to the DOM.

  • This can happen when the page is refreshed, updated, or changed in some way.

  • To overcome stale element exception, you can re-locate the elem...read more

Q27. Write a test script for a given scenario in any of your suitable framework

Ans.

Write a test script for a given scenario in any suitable framework

  • Identify the scenario to be tested

  • Create test data if needed

  • Write test steps using the chosen framework

  • Execute the test script and analyze results

Q28. write the xpath or CSS code for selected value in the amazon site

Ans.

XPath code for selected value in Amazon site

  • Use the 'contains' function to locate the selected value

  • Identify the unique attributes of the selected value to create a specific XPath

  • Consider using the 'text()' function to locate text within an element

Q29. Are you involved in test plans

Ans.

Yes, I am involved in test plans.

  • I collaborate with the team to create and review test plans.

  • I ensure that the test plans cover all the necessary scenarios.

  • I update the test plans as needed based on changes in requirements or functionality.

  • I use the test plans to guide my testing efforts and report any issues found.

Q30. Write a program to find duplicate elements in an array

Ans.

Program to find duplicate elements in an array of strings

  • Create a HashSet to store unique elements

  • Iterate through the array and check if element is already in the HashSet

  • If element is already in the HashSet, it is a duplicate

Q31. how would ypu explain the traversal of graphs

Ans.

Traversal of graphs involves visiting each vertex and edge in a graph in a systematic way.

  • Traversal can be done using algorithms like Depth First Search (DFS) or Breadth First Search (BFS).

  • DFS explores as far as possible along each branch before backtracking, while BFS explores neighbors before moving on.

  • Traversal can be used to find paths, cycles, connected components, or perform other graph operations.

  • Example: Traversing a social network graph to find friends of friends.

  • Exa...read more

Q32. How to validate API through postman?

Ans.

Validating API through Postman involves sending requests, receiving responses, and verifying data.

  • Create a new request in Postman and enter the API endpoint

  • Add any required headers, parameters, or body data

  • Send the request and check the response status code

  • Verify the response body for expected data or values

  • Use assertions in Postman to validate response data

  • Save the request in a collection for future testing

Q33. What are different type of testing?

Ans.

Different types of testing include functional testing, non-functional testing, manual testing, automated testing, regression testing, and performance testing.

  • Functional testing: Testing the functionality of the software against the requirements.

  • Non-functional testing: Testing aspects like performance, usability, and security.

  • Manual testing: Testing performed manually by testers.

  • Automated testing: Testing performed using automation tools.

  • Regression testing: Testing to ensure t...read more

Q34. What are different types of APIs?

Ans.

APIs can be categorized into different types such as REST, SOAP, GraphQL, and RPC.

  • RESTful APIs: Representational State Transfer APIs use standard HTTP methods like GET, POST, PUT, DELETE for communication.

  • SOAP APIs: Simple Object Access Protocol APIs use XML for message exchange over a network.

  • GraphQL APIs: Query language for APIs that allows clients to request only the data they need.

  • RPC APIs: Remote Procedure Call APIs allow a program to execute code on a remote server.

Q35. What are the exception you got in selenium

Ans.

Some common exceptions in Selenium include NoSuchElementException, TimeoutException, StaleElementReferenceException, and ElementNotVisibleException.

  • NoSuchElementException occurs when an element could not be found in the DOM.

  • TimeoutException occurs when a command does not complete in the specified time.

  • StaleElementReferenceException occurs when an element is no longer attached to the DOM.

  • ElementNotVisibleException occurs when an element is present in the DOM but not visible on...read more

Q36. Write a java program to convert the first letter of each word in upper case

Ans.

Java program to convert first letter of each word to upper case

  • Split the input string into an array of words

  • Iterate through each word and capitalize the first letter

  • Join the words back together into a single string

Q37. Write a java program to remove the duplicate characters from a string

Ans.

Java program to remove duplicate characters from a string

  • Create a HashSet to store unique characters

  • Iterate through the string and add each character to the HashSet

  • Construct a new string by appending characters from the HashSet

Q38. Where have you used Interface in your project

Ans.

I have used interfaces in my project to achieve abstraction and decoupling of components.

  • Used interfaces to define a contract for classes to implement

  • Implemented interfaces to provide a common set of methods for different classes

  • Utilized interfaces to enable polymorphism and dependency injection

Q39. Implicit and Explicit wait, key difference and the syntax.

Ans.

Implicit and Explicit wait are used in Selenium for handling synchronization issues in test automation.

  • Implicit wait is set globally for the entire test script, while explicit wait is applied only to specific elements.

  • Implicit wait waits for a specified amount of time before throwing a NoSuchElementException, while explicit wait waits for a specific condition to be met before proceeding.

  • Syntax for implicit wait: driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);...read more

Q40. Java constructor oops concepts and code for swapping two numbers

Ans.

Java constructor is a special type of method used to initialize objects. Swapping two numbers can be done using a temporary variable.

  • Java constructor is used to initialize objects in a class.

  • Swapping two numbers can be done by using a temporary variable.

  • Example code for swapping two numbers using constructor:

  • public class NumberSwapper {

  • int num1;

  • int num2;

  • public NumberSwapper(int a, int b) {

  • num1 = a;

  • num2 = b;

  • }

  • public void swapNumbers() {

  • int temp = num1;

  • num1 = num2;

  • num2...read more

Q41. Separate 1's and 0's in an array with minimal complexity

Ans.

Use two pointers approach to separate 1's and 0's in an array of strings with minimal complexity.

  • Initialize two pointers, one at the beginning and one at the end of the array.

  • Move the left pointer until it encounters a '0' and the right pointer until it encounters a '1'.

  • Swap the elements at the left and right pointers, then move the pointers towards each other until they meet in the middle.

Q42. What is regression testing, automation testing

Ans.

Regression testing is retesting software to ensure new changes haven't affected existing functionality. Automation testing is using tools to execute test cases.

  • Regression testing ensures that new code changes haven't affected existing functionality

  • Automation testing involves using tools to execute test cases automatically

  • Regression testing is often performed after code changes or updates

  • Automation testing helps in saving time and effort by automating repetitive test cases

  • Exam...read more

Q43. Java Program for count of characters in the given string

Ans.

Java program to count characters in a given string

  • Use a HashMap to store characters and their counts

  • Iterate through the string and update the counts in the HashMap

  • Print the characters and their counts at the end

Q44. Why python why not others language?

Ans.

Python is a popular choice for automation testing due to its simplicity, readability, extensive libraries, and cross-platform compatibility.

  • Python has a simple and readable syntax, making it easy to write and understand test scripts.

  • Python has a large number of libraries and frameworks specifically designed for automation testing, such as Selenium and PyTest.

  • Python is cross-platform compatible, allowing tests to be run on different operating systems.

  • Python integrates well wit...read more

Q45. Python- Explain how to take input from user

Ans.

Use the input() function in Python to take input from the user.

  • Use the input() function to prompt the user for input and store the input in a variable.

  • You can specify a prompt message inside the input() function to guide the user on what to input.

  • The input() function always returns a string, so you may need to convert the input to the desired data type if needed.

Q46. What is test strategies and test plans

Ans.

Test strategies and test plans are essential documents that outline the approach and scope of testing activities.

  • Test strategy defines the overall testing approach, including objectives, resources, and timelines.

  • Test plan details the specific tests to be conducted, including test cases, test data, and expected results.

  • Test strategy is high-level and focuses on the big picture, while test plan is more detailed and specific.

  • Both documents are crucial for ensuring thorough and e...read more

Q47. what is difference between PUT and POST

Ans.

PUT is used to update or replace an existing resource, while POST is used to create a new resource.

  • PUT is idempotent, meaning multiple identical requests will have the same effect as a single request

  • POST is not idempotent, meaning multiple identical requests may have different effects

  • PUT requires the client to specify the URI of the resource to update, while POST does not

  • PUT is typically used for updating existing resources, while POST is used for creating new resources

Q48. How to automate filters in web page

Ans.

Automating filters in a web page involves identifying filter elements, selecting filter criteria, and verifying filtered results.

  • Identify filter elements on the web page such as dropdowns, checkboxes, or input fields

  • Use automation tools like Selenium to interact with filter elements and select desired criteria

  • Trigger filter action (e.g. clicking 'Apply' button) and wait for the page to refresh with filtered results

  • Verify that the filtered results match the selected criteria b...read more

Q49. What is differences between smoke and sanity

Ans.

Smoke testing is a quick test to check if the build is stable, while sanity testing is a more thorough test to check if the specific functionalities are working as expected.

  • Smoke testing is done to ensure the stability of the build before further testing, while sanity testing is done to ensure the specific functionalities are working correctly.

  • Smoke testing is a subset of regression testing, while sanity testing is a subset of acceptance testing.

  • Smoke testing is usually done ...read more

Q50. explain authorization and authentication

Ans.

Authentication verifies a user's identity, while authorization determines what actions they are allowed to perform.

  • Authentication confirms the user's identity through credentials like passwords or biometrics.

  • Authorization controls the access rights of authenticated users to specific resources or actions.

  • Examples include logging into a website with a username and password (authentication) and being able to view/edit certain pages based on user roles (authorization).

1
2
3
4
Next
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

3.7
 • 10.4k Interviews
3.6
 • 7.6k Interviews
3.7
 • 5.6k Interviews
3.8
 • 5.6k Interviews
4.1
 • 5k Interviews
4.0
 • 2.4k Interviews
3.7
 • 896 Interviews
3.8
 • 533 Interviews
View all

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

Sdet Automation Test Engineer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter