25+ Must-Know Test Automation Interview Questions & Answers
Test Automation Interview Questions and Answers

25+ Must-Know Test Automation Interview Questions & Answers

Last updated on 04th Jul 2020, Blog, Interview Questions

About author

Bibin (Sr Project Manager )

He is a Proficient Technical Expert for Respective Industry Domain & Serving 8+ Years. Also, Dedicated to Imparts the Informative Knowledge's to Freshers. He Share's this Blogs for us.

(5.0) | 16547 Ratings 1012

These Test Automation Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of Test Automation  . As per my experience good interviewers hardly plan to ask any particular question during your interview, normally questions start with some basic concept of the subject and later they continue based on further discussion and what you answer.we are going to cover top 100Test Automation Interview questions along with their detailed answers. We will be coveringTest Automation scenario based interview questions, Test Automation  interview questions for freshers as well as Test Automation  interview questions and answers for experienced.

Q1. What is Automation testing?

Ans:

Automation Testing is a technique using an automation tool to write and execute tester’s test scripts and cases.The main goal of Automation Testing is to reduce the number of test cases to be run manually and not eliminate Manual Testing altogether.

Q2. When will you automate a test?

Ans:

Automation in preferred in following cases

  • Repetitive Tasks
  • Smoke and Sanity Tests
  • Test with multiple data set
  • Regression test cases

Q3. When will you not automate testing?

Ans:

One should not automate in following cases

  • When the Application Under Test changes frequently
  • One time test cases
  • Adhoc – Random testing

Q4. What are the steps involved in the Automation Process?

Ans:

In the automation process, steps involved are:

  • Selecting the Test tool
  • Define scope of automation
  • Planning, design, and development
  • Test execution
  • Maintenance

Q5. What are the points that are covered while planning phase of automation?

Ans:

During planning phase of automation things which must be taken in concern are

  • Selection the “right” Automation tool
  • Selection Automation Framework if any
  • List of In scope and out of scope items for automation
  • Test Environment Setup
  • Preparing Grant Chart of Project timelines for test script development & execution.
  • Identify Test Deliverables

Q6. In what condition we cannot use automation testing for the Agile method?

Ans:

Automation testing is not useful for agile methods in following conditions

  • When Agile testing always ask for changes in requirements
  • When Exhaustive level of documentation is required in Agile
  • Only suitable for those regression tests during agile testing like continuous integration

Q7. What are the primary features of good automation tool?

Ans:

  • Test Environment support and easy to use
  • Good debugging facility
  • Robust object identification
  • Object and Image testing abilities
  • Object identification
  • Testing of database
  • Support multiple frameworks

Q8. What are the types of the framework used in software automation testing?

Ans:

In software automation testing four types of framework used are

  • Data-driven automation framework
  • Keyword driven automation framework
  • Modular automation framework
  • Hybrid automation framework

Q9. What is the scripting standard while performing automation testing?

Ans:

While writing the scripts for automation, you must consider following things,

  • Uniform naming convention.
  • 3 Lines of comments for every 10 lines of code
  • Adequate indentation.
  • Robust error handling and recovery scenario
  • Use of Frameworks wherever possible

Q10. What are the most popular tools for automation testing?

Ans:

The most popular test tool for automation testing are

  • QTP (HP UFT)
  • Rational Robot
  • Selenium

Q11. What is Automation?

Ans:

Automation is any action that can reduce human efforts.

Q12. What all things can you automate?

Ans:

  • Regression test suite
  • Smoke / Sanity test suite
  • Build deployment
  • Test data creation
  • Automating behind the GUI like testing of APIs and methods.

Q13. When is Automation testing useful?

Ans:

Automation testing is useful in the following scenarios:

  • Regression testing: In case of a bug fix or new module implementation, we have to make sure that the already implemented or unchanged functionality is not affected. In this case, we end up running the regression test case multiple times.For Example: After each change request or bug fix, after each iteration in case of incremental development approach, etc.
  • Non-functional Testing: Testing the non-functional aspects of an application.For Example, Load testing or performance testing, etc are very difficult for humans to track and analyze.
  • Complex calculation checks or test scenarios that are prone to human errors.
  • Repeated execution of the same tests: Sometimes, we have to run the same set of test case for a different set of data or after each build release or on multiple hardware, software or combination of both.Automating the test cases in the above scenarios helps in achieving the speed of testing and minimizing human errors.

Q14. How do you identify the test cases which are suitable for automation?

Ans:

Identifying the appropriate test cases for automation is the most important step towards automation.

Q15. Can you achieve 100% automation?

Ans:

100% automation would be difficult to achieve because there would be many edge test cases and some cases that are executed seldom. Automating these cases which are not executed that often will not add value to the automated suite.

Q16. How to decide the tool that one should use for Automation testing in their projects?

Ans:

In order to identify the tool for Automation testing in your project:

  • Understand your project requirements thoroughly and identify the testing scenarios that you want to automate.
  • Search for the list of tools that support your project’s requirements.
  • Identify your budget for the automation tool. Select the tools within your budget.
  • Identify if you already have skilled resources for the tools. If you don’t have the necessary skilled resources then identify the cost for training the existing resources or hiring new resources.
  • Once you have compared the tools, select the tool which is within your budget and support your project requirements, and gives you more advantages based on the key criteria mentioned above.

Q17. Currently I do not have any automation in place in my project, but now I want to implement automation, what would be my steps?

Ans:

  • First, identify which type of testing/test cases you want to automate.
  • Identify the tool
  • Design the framework
  • Create utility files and environment files.
  • Start scripting
  • Identify and work on reporting.
  • Allocating time for enhancing and maintaining the scripts.

Steps required for getting Automation Testing in place for a project include:

  • Understand the advantages and disadvantages of automation testing and identify the test scenarios which are suitable for automation.
  • Select the automation tool that is best suited for automating the identified scenarios
  • Find the tool expert to help in setting up the tool and required environment for executing the test cases using the tool.
  • Train the team so that they can write scripts in the programming language that the tool supports.
  • Create the test framework or identify the already existing one that meets your requirements.
  • Write an execution plan for OS, browsers, mobile devices, etc.
  • Write programming scripts for manual test cases to convert them into automated test cases.
  • Report the test case status by using the reporting feature of the tool.
  • Maintain the scripts for ongoing changes or new features.

Q18. How do you decide which tool you have to use?

Ans:

Concluding which tool is best suitable for the project requires a lot of brainstorming and discussions.

Q19. Once you identify the tool what would be your next steps?

Ans:

Once we finalize the tool, our next step would be to design the framework.

Q20. On what basis you can map the success of automation testing?

Ans:

By following criteria, the success of automation testing can be mapped

  • Defect Detection Ratio
  • Automation execution time and time savings to release the product
  • Reduction in Labour & other costs

    Subscribe For Free Demo

    Q21. Can list out some disadvantages of manual testing?

    Ans:

    • Manual Software Testing requires more time and more resources.
    • Inaccuracy
    • Executing same test case repeatedly is error prone and boring.
    • It is impractical to do manual testing on very large projects and time bounded projects.

    Q22. Tell me what you know about Selenium?

    Ans:

    Selenium is a free (open source) Test automation library. It is used to automate Web and Mobile environments. It consists of

    • Selenium IDE (Browser Addon – Record and Playback Tool)
    • Selenium WebDriver
    • Selenium Grid (Distributed Testing)

    Selenium supports scripting in languages like Java, C#, Python, Ruby, PHP, Perl, Javascript.

    Q23. What is QTP?

    Ans:

    • QTP (Quick Test Professional) is now known as HP UFT. It is a commercial automation tool and supports a very wide range of test environments Web, Desktop, SAP, Delphi, Net, ActiveX, Flex, Java, Oracle, Mobile, PeopleSoft, PowerBuilder, Siebel, Stingray, Visual Basic amongst others.The scripting language is VBScript.
    • The tool gels well with HP ALM (Test Management Tool) and HP LoadRunner (Performance Testing Tool).Salient features of QTP include Business Process Testing, keyword driven framework, XML support, robust checkpoints, test results.

    Q24. Explain what Sikuli is?

    Ans:

    Sikuli is a tool that uses “Visual Image Match” method to automate graphical user interface. All the web elements in Sikuli should be taken as an image and stored inside the project.

    Sikuli is comprised of:

    • Sikuli Script
    • Visual Scripting API for Jython
    • Sikuli IDE

    Practical uses of Sikuli is that:

    • It can be used to automate flash websites or objects
    • It can automate window based application and anything you see on screen without using internal API support
    • It provides simple API
    • It can be easily linked with tools like Selenium
    • Desktop application can be automated
    • Sikuli offers extensive support to automate flash objects
    • To automate desktop, it uses powerful “Visual Match” and Flash objects
    • It can work on any technology-.NET, Java,

    Q25. What is a framework?

    Ans:

    A framework is a set of the structure of the entire automation suite. It is also a guideline, which if followed can result in a structure that is easy to maintain and enhance.

    Q26. What are the attributes of a good framework?

    Ans:

    The characteristics include:

    • Modular: The framework should be adaptable to change. Testers should be able to modify the scripts as per the environment or login information change.
    • Reusable: The commonly used methods or utilities should be written in a common file that is accessible to all the scripts.
    • Consistent: The suite should be written in a consistent format by following all the accepted coding practices.
    • Independent: The scripts should be written in such a way that they are independent of each other. In case one test fails, it should not hold back the remaining test cases (unless it is a login page)
    • Logger: It is good to have implemented the logging feature in the framework. This would help in case our scripts run for longer hours (say nightly mode), if the script fails at any point of time, having the log file will help us to detect the location along with the type of the error.
    • Reporting: It is good to have the reporting feature automatically embedded into the framework. Once the scripting is done, we can have the results and reports sent via email.
    • Integration: Automation Framework should be such that it is easy to integrate with other applications like continuous integration or triggering the automated script as soon as the build is deployed.

    Q27. Can you do without a framework?

    Ans:

    Frameworks are guidelines and not mandatory rules, so we can do without a framework, but if we create it and follow it, enhancing and maintaining would be easy to implement.

    Q28. What are the different types of the Automation tool that you are aware of?

    Ans:

    • Open source tool like Selenium, JMeter, etc.
    • Paid tools like QTP, Load Runner, Ranorex, RFT, and Rational Robot.

    Q29. What generally is the structure of a framework?

    Ans:

    Normally the structure should have – (It would differ from project to project)

    • A “src” (source) folder having the actual test scripts.
    • A”lib” (library) folder having all the libraries and common methods.
    • A “class” folder having all the class file (in-case using java).
    • A “log” folder having the log file(s).
    • A file/folder having all the web element Ids.
    • A file containing the URL, environment and login information.

    Q30. Where will you maintain information like URL, login, password?

    Ans:

    This information should always be maintained in a separate file.

    Q31. What are the benefits of Automation Testing?

    Ans:

    Benefits of Automation testing are:

    • Supports execution of repeated test cases
    • Aids in testing a large test matrix
    • Enables parallel execution
    • Encourages unattended execution
    • Improves accuracy thereby reducing human-generated errors
    • Saves time and money

    Q32. Why should Selenium be selected as a test tool?

    Ans:

    • is a free and open source
    • have a large user base and helping communities
    • have cross Browser compatibility (Firefox, Chrome, Internet Explorer, Safari etc.)
    • have great platform compatibility (Windows, Mac OS, Linux etc.)
    • supports multiple programming languages (Java, C#, Ruby, Python, Pearl etc.)
    • has fresh and regular repository developments
    • supports distributed testing

    Q33. What are the different Selenium components?

    Ans:

    • Selenium is not just a single tool or a utility, rather a package of several testing tools and for the same reason, it is referred to as a Suite. Each of these tools is designed to cater different testing and test environment requirements.

    The suite package constitutes the following sets of tools:

    • Selenium Integrated Development Environment (IDE) – Selenium IDE is a record and playback tool. It is distributed as a Firefox Plugin.
    • Selenium Remote Control (RC) – Selenium RC is a server that allows a user to create test scripts in the desired programming language. It also allows executing test scripts within the large spectrum of browsers.
    • Selenium WebDriver – WebDriver is a different tool altogether that has various advantages over Selenium RC. WebDriver directly communicates with the web browser and uses its native compatibility to automate.
    • Selenium Grid – Selenium Grid is used to distribute your test execution on multiple platforms and environments concurrently.

    Q34. What are the testing types that can be supported by Selenium?

    Ans:

    Selenium supports the following types of testing:

    • Functional Testing
    • Regression Testing

    Q35. What are the limitations of Selenium?

    Ans:

    Following are the limitations of Selenium:

    • Selenium supports testing of only web-based applications
    • Mobile applications cannot be tested using Selenium
    • Captcha and Barcode readers cannot be tested using Selenium
    • Reports can only be generated using third-party tools like TestNG or JUnit.
    • As Selenium is a free tool, thus there is no ready vendor support through the user can find numerous helping communities.
    • The user is expected to possess prior programming language knowledge.

    Q36. When should I use Selenium IDE?

    Ans:

    Selenium IDE is the simplest and easiest of all the tools within the Selenium Package. Its record and playback feature makes it exceptionally easy to learn with minimal acquaintances to any programming language. Selenium IDE is an ideal tool for a naïve user.

    Q37. What is Selenese?

    Ans:

    Selenese is the language which is used to write test scripts in Selenium IDE.

    Course Curriculum

    Gain Hands-on Experience with Test Automation Certification Course

    Weekday / Weekend BatchesSee Batch Details

    Q38. What are the different types of locators in Selenium?

    Ans:

    The locator can be termed as an address that identifies a web element uniquely within the webpage. Thus, to identify web elements accurately and precisely we have different types of locators in Selenium:

    • ID
    • ClassName
    • Name
    • TagName
    • LinkText
    • PartialLinkText
    • Xpath
    • CSS Selector
    • DOM

    Q39. What is the difference between assert and verify commands?

    Ans:

    • Assert: Assert command checks whether the given condition is true or false. Let’s say we assert whether the given element is present on the web page or not. If the condition is true then the program control will execute the next test step but if the condition is false, the execution would stop and no further test would be executed.
    • Verify: Verify command also checks whether the given condition is true or false. Irrespective of the condition being true or false, the program execution doesn’t halt i.e. any failure during verification would not stop the execution and all the test steps would be executed.

    Q40. Why do you want to keep this kind of information in a separate file and not directly in the code?

    Ans:

    URL, Login, and passwords are the kind of fields that are used very often and these change as per the environment and authorization. In case we hardcode it into our code, we have to change it in every file which has its reference.In case if there are more than 100 files, then it becomes very difficult to change all the 100 files and this, in turn, can lead to errors. So this kind of information is maintained in a separate file so that updating becomes easy.

    Q41. What are the different types of frameworks?

    Ans:

    Different types of frameworks includes:

    • Keyword-driven framework
    • Data-Driven framework
    • Hybrid Framework
    • Linear Scripting

    Q43. Can you tell some good coding practices while automation?

    Ans:

    Some of the good coding practices include:

    • Add appropriate comments.
    • Identify the reusable methods and write it in a separate file.
    • Follow the language-specific coding conventions.
    • Maintain the test data in a separate file.
    • Run your scripts regularly.

    Q44. Any kind of test which you think should not be automated?

    Ans:

    • Tests that are seldom executed.
    • Exploratory testing
    • Usability testing
    • Test which is executed quickly when done manually.

    Q45. Do you think that testing can be done only at the UI level?

    Ans:

    • Today as we are moving to the Agile mode, testing is not limited to the UI layer. Early feedback is imperial for an agile project. If we concentrate only on the UI layer, we are actually waiting until the UI is developed and available to test.Rather we can test even before the UI is actually developed. We can directly test the APIs or the methods using tools like Cucumber and FitNesse.
    • In this way, we are giving the feedback much early and are testing even before the UI is developed. Following this approach will help us to test only the GUI aspect of small cosmetic changes or some validations on the UI and will help the developers by giving more time to fix the bugs.

    Q46. How do you select which automation tool is best suited for you?

    Ans:

    Selecting the automation tool depends upon various factors like:

    • The scope of the application which we want to automate.
    • Management overhead like cost and budget.
    • Time to learn and implement the tool.
    • Type of support available for the tool.
    • Limitation of the tool

    Q47. What do you think holds the testers back to do automation? Is there a way to overcome it?

    Ans:

    • The major hurdle for testers is to learn programming/coding when they want to automate. Since testers do not code, adapting to coding is a bit challenging for testers.

    We can overcome it by:

    • Collaborating with developers when automating.
    • Considering that automation is the responsibility of the whole team and not only of the testers.
    • Giving a dedicated time and focus on automation.
    • Getting proper management support.

    Q48. What is an Automation testing framework?

    Ans:

    • A framework, in general, is a set of guidelines. A set of guidelines, assumptions, concepts and coding practices for creating an execution environment in which the tests will be automated, is known as an Automation testing framework.
    • An automation testing framework is responsible for creating a test harness with a mechanism to connect with the application under test, take input from a file, execute the test cases and generate the reports for test execution. An automation testing framework should be independent of the application and it should be easy to use, modify or extend.

    Q49. What are the important modules of an automation testing framework?

    Ans:

    Important modules of an Automation testing framework are:

    • Test Assertion Tool: This tool will provide assert statements for testing the expected values in the application under test. For Example. TestNG, Junit, etc.
    • Data Setup: Each test case needs to take the user data either from the database or from a file or embedded in the test script. Frameworks data module should take care of the data intake for test scripts and the global variables.
    • Build Management Tool: Framework needs to be built and deployed for the use of creating test scripts.
    • Continuous integration tool: With CICD (Continuous Integration and Continuous Development) in place, continuous integration tool is required for integrating and deploying the changes done in the framework at each iteration.
    • Reporting tool: A reporting tool is required to generate a readable report after the test cases are executed for a better view of the steps, results, and failures.
    • Logging tool: The logging tool in framework helps in better debugging of the error and bugs.

    Q50. Explain some Automation testing tools?

    Ans:

    Some of the famous Automation testing tools are explained below:

    • Selenium: Selenium is a test framework for web application automation testing. It supports multiple browsers and is OS independent. Selenium also supports various programming languages like Java, C#, PHP, Ruby, and Perl, etc.Selenium is an open-source set of libraries which can be used to develop additional test frameworks or test scripts for testing web-based applications.
    • UFT: Unified Functional Testing is a licensed tool for functional testing. It provides a wide range of features like APIs, web services, etc and also supports multiple platforms like desktops, web, and mobile. UFT scripts are written in visual basic scripting language.
    • Appium: Appium is an open-source mobile application testing tool. It is used to automate testing on cross-platform, native, hybrid and web-based mobile applications. Appium automates any mobile application from any language with full access to APIs and DBs from the test code.Appium is based on the client-server architecture and has evolved from selenium.
    • Cucumber: Cucumber is an open-source behavior-driven development tool. It is used for web-based application automation testing and supports languages like ruby, java, scala, groovy, etc. Cucumber reads executable specification written in plain text and tests the application under test for those specifications.For cucumber to understand the scenarios in plain text, we have to follow some basic syntax rules which are known as Gherkin.
    • TestComplete: TestComplete is a licensed automated UI testing tool to test the application across different platforms like desktops, web, mobile, etc. It provides flexibility to record a test case on one browser and run it on multiple browsers and thus supports cross browsers testing.TestComplete has inbuilt object recognition algorithm which uniquely identifies an object and stores it in the repository.

    Q51. What is an XPath?

    Ans:

    XPath is used to locate a web element based on its XML path. XML stands for Extensible Markup Language and is used to store, organize and transport arbitrary data. It stores data in a key-value pair which is very much similar to HTML tags. Both being markup languages and since they fall under the same umbrella, XPath can be used to locate HTML elements.

    Q52. What is the difference between “/” and “//” in Xpath?

    Ans:

    • Single Slash “/” – Single slash is used to create Xpath with absolute path i.e. the xpath would be created to start selection from the document node/start node.
    • Double Slash “//” – Double slash is used to create Xpath with relative path i.e. the xpath would be created to start selection from anywhere within the document.

    Q53. What is Same origin policy and how it can be handled?

    Ans:

    • The problem of same origin policy disallows to access the DOM of a document from an origin that is different from the origin we are trying to access the document.Origin is a sequential combination of scheme, host, and port of the URL. For example, for a URL https://www.softwaretestinghelp.com/resources/, the origin is a combination of http, softwaretestinghelp.com, 80 correspondingly.
    • Thus the Selenium Core (JavaScript Program) cannot access the elements from an origin that is different from where it was launched. For Example, if I have launched the JavaScript Program from “https://www.softwaretestinghelp.com”, then I would be able to access the pages within the same domain such as “https://www.softwaretestinghelp.com/resources” or “https://www.softwaretestinghelp.com/istqb-free-updates/”. The other domains like google.com, seleniumhq.org would no more be accessible.So, In order to handle the same origin policy, Selenium Remote Control was introduced.

    Q54. When should I use Selenium Grid?

    Ans:

    Selenium Grid can be used to execute same or different test scripts on multiple platforms and browsers concurrently so as to achieve distributed test execution, testing under different environments and saving execution time remarkably.

    Q55. What do we mean by Selenium 1 and Selenium 2?

    Ans:

    Selenium RC and WebDriver, in a combination, are popularly known as Selenium . Selenium RC alone is also referred to as Selenium

    Q56. Which is the latest Selenium tool?

    Ans:

    WebDriver

    Q57. How do I launch the browser using WebDriver?

    Ans:

    The following syntax can be used to launch Browser:

    • WebDriver driver = new FirefoxDriver();
    • WebDriver driver = new ChromeDriver();
    • WebDriver driver = new InternetExplorerDriver();

    Q58. What are the different types of Drivers available in WebDriver?

    Ans:

    The different drivers available in WebDriver are:

    • FirefoxDriver
    • InternetExplorerDriver
    • ChromeDriver
    • SafariDriver
    • OperaDriver
    • AndroidDriver
    • IPhoneDriver
    • HtmlUnitDriver

    Q59. What are the different types of waits available in WebDriver?

    Ans:

    There are two types of waits available in WebDriver:

    • Implicit Wait: Implicit waits are used to provide a default waiting time (say 30 seconds) between each consecutive test step/command across the entire test script. Thus, the subsequent test step would only execute when the 30 seconds have elapsed after executing the previous test step/command.
    • Explicit Wait: Explicit waits are used to halt the execution till the time a particular condition is met or the maximum time has elapsed. Unlike Implicit waits, explicit waits are applied for a particular instance only.

    Q60. How to type in a textbox using Selenium?

    Ans:

    The user can use sendKeys(“String to be entered”) to enter the string in the textbox.

    Course Curriculum

    Best JOB Oriented Test Automation Training With Industry Experts

    • Instructor-led Sessions
    • Real-life Case Studies
    • Assignments
    Explore Curriculum

    Q61. What is the Syntax to type textbox using selenium?

    Ans:

      • WebElement username = drv.findElement(By.id(“Email”));
      • // entering username
      • username.sendKeys(“sth”);

    Q62. How can you find if an element in displayed on the screen?

    Ans:

    WebDriver facilitates the user with the following methods to check the visibility of the web elements. These web elements can be buttons, drop boxes, checkboxes, radio buttons, labels etc.

    • isDisplayed()
    • isSelected()
    • isEnabled()

    Q63. What is the Syntax to find if an element in displayed on the screen?

    Ans:

    isDisplayed():

    • boolean buttonPresence = driver.findElement(By.id(“gbqfba”)).isDisplayed();

    isSelected():

    • boolean buttonSelected = driver.findElement(By.id(“gbqfba”)).isSelected();

    isEnabled():

    • boolean searchIconEnabled = driver.findElement(By.id(“gbqfb”)).isEnabled();

    Q64. What are the different types of testing framework techniques?

    Ans:

    There are four types of automation testing framework techniques.

    They are:

    • Modular Testing framework:
    • Data-Driven Testing framework:
    • Keyword-Driven Testing framework:
    • Hybrid Testing framework:

    Q65. When do you prefer Manual testing over Automation testing?

    Ans:

    We prefer manual testing over automation testing in the following cases:

    • The project is short-term and writing scripts will be time-consuming and costly when compared to manual testing.
    • Flexibility is required. Automated test cases are programmed and run in a specific way of configurations.
    • Usability testing needs to be performed.
    • Applications/module is newly developed and has no previous test cases.
    • Ad-hoc or exploratory testing needs to be performed.

    Q66. Define Modular Testing framework?

    Ans:

    This framework is built on the concept of abstraction. In this framework, the tester creates scripts for each module of the application under test individually and then these scripts are combined in the hierarchical order to create large test cases.It creates an abstraction layer between the modules, thus any modifications in test scripts for one module do not affect any other modules.

    Q67. Is Automation testing in agile Methodology useful or not?

    Ans:

    • Automation testing is useful for regression, smoke or sanity testing. All these types of testing in the traditional waterfall model happen at the end of the cycle and sometimes if there are not many enhancements to the application, we might not even have to do regression testing.Whereas, in agile methodology, every iteration requires executing the regression test case as some new functionalities is added.
    • Also, the regression suite itself keeps growing after each sprint as the functional test cases of the current sprint module need to be added to the regression suite for the next sprint.
    • Thus, Automation testing in agile methodology is very useful and helps in achieving maximum test coverage in less time of the sprint.

    Q68. List some advantages and disadvantages of Automation testing?

    Ans:

    Advantages:

    • Fewer human resources
    • Reusability
    • More Test Coverage in less time
    • Reliability
    • Parallel execution of test cases
    • Fast

    Disadvantages:

    • Development and maintenance time is more.
    • Tool Cost
    • Skilled resources are required.
    • Environment setup
    • Test Script debugging is an issue.

    Q69. Explain Keyword-Driven Testing framework?

    Ans:

    It is an application-independent testing framework that uses data tables and self-explanatory keywords. Keywords explain the actions to be performed on the application under test and the data table provides the input and expected output data. Keyword-based testing is an increment to data-driven testing.

    Q70. List some advantages and disadvantages of Manual testing?

    Ans:

    Advantages:

    • No environment setup needed.
    • Programming knowledge is not required.
    • Recommended for dynamically changing requirements.
    • Allow human observation power to detect more bugs.
    • The cost is less for short-term projects.
    • Flexibility

    Disadvantages:

    • Difficult to perform complex calculations.
    • Reusability
    • Time taking
    • High risk of human errors or mistakes.
    • More human resources are required.

    Q71. Can we do Automation testing without a framework? If yes, then why do we need a framework?

    Ans:

    • Yes, We can perform automation testing even without using a framework. We can just understand the tool that we are using for automation and program the steps in the programming language that tools support.If we automate test cases without a framework then there won’t be any consistency in the programming scripts for test cases.
    • A framework is required to give a set of guidelines that everyone has to follow to have maintained readability, reusability, and consistency in the test scripts. A framework also provides one common ground for reporting and logging functionality.

    Q72. How will you automate basic “login” functionality test cases for an application?

    Ans:

    • Assuming that the automation tool and framework is already in place of the test environment.

    To test the basic “Login” functionality:

    • Understand the project requirement: Login functionality will have a username textbox, a password textbox, and a login button.

    Identify the Test scenarios: For login functionality, the possible test scenarios are:

    • Blank username and password
    • Invalid username and password
    • A valid username and invalid password
    • Valid username and password

    Prepare a Data input file with the data corresponding to each scenario.

    • Launch the tool from the program.
    • Identify the username field, password field, and the login button.
    • For each test scenario, get the data from the data file and enter into the corresponding fields. Program click on the login button after entering the data.
    • Validate the error message for negative scenarios and the success message for positive scenarios in the test script with the help of assertions.
    • Run the test suite and generate the report.

    Q73. Is Automation testing a Black box testing or White-box testing?

    Ans:

    Automation testing is mostly a black box testing as we just program the steps that a manual tester performs for application under test without knowing the low-level design or code of the application.Sometimes, automated test scripts need access to the database details that are used in the application under test or some more coding details and thus can be a type of white-box testing.Thus automated testing can be both black or white box type of testing depending on the scenarios in which automation is performed.

    Q74. How many test cases have you automated per day?

    Ans:

    • Well, the number depends on the complexity of the test cases. When the complexity was limited, I was able to automate 5 to 6 test cases per day. Sometimes, I was able to automate only one test case for complex scenarios.
    • I have also broken down my test cases into different components like, take input, do the calculation, verify the output etc. in case of very complex scenarios and have taken 2 or more days.

    Q75. What factors determine the effectiveness of Automation testing?

    Ans:

    Some of the factors that determine the effectiveness of automation testing are:

    • Time saved by running scripts over the manual execution of test cases.
    • Defects found
    • Test Coverage or code coverage
    • Maintenance time or development time
    • Stability of the scripts
    • Test Reusability
    • Quality of the software under test

    Q76. Which test cases can be automated?

    Ans:

    Types of test cases which can be automated are:

    • Smoke test cases: Smoke testing is also known as build verification testing. Smoke test cases are run every time when a new build is released to check the health of the build for acceptance to perform testing.
    • Regression Test Cases: Regression testing is the testing to ensure that previously developed modules are functioning as expected after a new module is added or a bug is fixed.
    • Regression test cases are very crucial in incremental software approach where a new functionality is added at each increment phase. In this case, regression testing is performed at each incremental phase.
    • Complex Calculation test cases: Test cases which involve some complex calculations to verify a field for an application fall into this category. Complex calculation results are more prone to human errors hence when automated they give accurate results.
    • Data-driven test cases: Test cases which have the same set of steps and run multiple times with the change of data are known as data-driven test cases. Automated testing for these kinds of test cases is quick and cost-effective.
    • Non-functional test cases: Test cases like load tests and performance tests require a simulated environment with multiple users and multiple hardware or software combinations.

    Q77. What are the phases in Automation testing Life Cycle?

    Ans:

    The phases in Automation testing life Cycle include:

    • The decision to perform automation testing.
    • Identify and learn about the automation tool.
    • Determine the scope of automation testing.
    • Design and develop a test suite.
    • Test Execution
    • Maintenance of test scripts.

    Q78. What is an Automated test script?

    Ans:

    • An automated test script is a short program that is written in a programming language to perform a set of instructions on an application under test to verify if the application is as per the requirements.
    • This program when run, gives the test results as pass or fail to depend on if the application is as per the expectations.

    Q79. How can we get a text of a web element?

    Ans:

    Get command is used to retrieve the inner text of the specified web element. The command doesn’t require any parameter but returns a string value. It is also one of the extensively used commands for verification of messages, labels, errors etc displayed on the web pages.

    Q80. What is the Syntax to get text of a web element?

    Ans:

    • String Text = driver.findElement(By.id(“Text”)).getText();

    Q81. How to select value in a dropdown?

    Ans:

    The value in the dropdown can be selected using WebDriver’s Select class.

    Selenium Sample Resumes! Download & Edit, Get Noticed by Top Employers! Download

    Q82. What is the Syntax to select value in a dropdown?

    Ans:

    selectByValue:

    • Select selectByValue = new Select(driver.findElement(By.id(“SelectID_One”)));
    • selectByValue.selectByValue(“greenvalue”);

    selectByVisibleText:

    • Select selectByVisibleText = new Select (driver.findElement(By.id(“SelectID_Two”)));
    • selectByVisibleText.selectByVisibleText(“Lime”);

    selectByIndex:

    • Select selectByIndex = new Select(driver.findElement(By.id(“SelectID_Three”)));
    • selectByIndex.selectByIndex(2);

    Q83. What are the different types of navigation commands?

    Ans:

    Following are the navigation commands:

    navigate().back() – The above command requires no parameters and takes back the user to the previous webpage in the web browser’s history.Sample code:

    • driver.navigate().back();

    navigate().forward() – This command lets the user to navigate to the next web page with reference to the browser’s history.Sample code:

    • driver.navigate().forward();

    navigate().refresh() – This command lets the user to refresh the current web page there by reloading all the web elements.Sample code:

    • driver.navigate().refresh();

    navigate().to() – This command lets the user to launch a new web browser window and navigate to the specified URL.Sample code:

    • driver.navigate().to(“https://google.com”);

    Q84. How to click on a hyper link using linkText?

    Ans:

    • driver.findElement(By.linkText(“Google”)).click();
    • The command finds the element using link text and then click on that element and thus the user would be re-directed to the corresponding page.The above-mentioned link can also be accessed by using the following command.
    • driver.findElement(By.partialLinkText(“Goo”)).click();
    • The above command finds the element based on the substring of the link provided in the parenthesis and thus partialLinkText() finds the web element with the specified substring and then clicks on it.

    Q85. How to handle frame in WebDriver?

    Ans:

    An inline frame acronym as iframe is used to insert another document within the current HTML document or simply a web page into a web page by enabling nesting.

    Select iframe by id

    • vdriver.switchTo().frame(“ID of the frame“);

    Locating iframe using tagName

    • driver.switchTo().frame(driver.findElements(By.tagName(“iframe”).get(0));Locating iframe using index

    frame(index)

    • driver.switchTo().frame(0);

    frame(Name of Frame)

    • driver.switchTo().frame(“name of the frame”);

    frame(WebElement element)
    Select Parent Window

    • driver.switchTo().defaultContent();

    Q86. When do we use findElement() and findElements()?

    Ans:

    findElement(): findElement() is used to find the first element in the current web page matching to the specified locator value. Take a note that only first matching element would be fetched.

    Syntax :

    WebElement element = driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));
    findElements(): findElements() is used to find all the elements in the current web page matching to the specified locator value. Take a note that all the matching elements would be fetched and stored in the list of WebElements.

    Syntax:

    • List <WebElement> elementList = driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));

    Q87. How to find more than one web element in the list?

    Ans:

    At times, we may come across elements of the same type like multiple hyperlinks, images etc arranged in an ordered or unordered list. Thus, it makes absolute sense to deal with such elements by a single piece of code and this can be done using WebElement List.

    Sample Code

    • // Storing the list
    • List <WebElement> elementList = driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));
    • // Fetching the size of the list
    • int listSize = elementList.size();
    • for (int i=0; i<listSize; i++)
    • {
    • // Clicking on each service provider link
    • serviceProviderLinks.get(i).click();
    • // Navigating back to the previous page that stores link to service providers
    • driver.navigate().back();
    • }

    Q88. What is the difference between driver.close() and driver.quit command?

    Ans:

    • close(): WebDriver’s close() method closes the web browser window that the user is currently working on or we can also say the window that is being currently accessed by the WebDriver. The command neither requires any parameter nor does it return any value.
    • quit(): Unlike close() method, quit() method closes down all the windows that the program has opened. Same as close() method, the command neither requires any parameter nor does is return any value.

    Q89. Can Selenium handle windows based pop up?

    Ans:

    Selenium is an automation testing tool which supports only web application testing. Therefore, windows pop up cannot be handled using Selenium.

    Q90. How can we handle web-based pop-up?

    Ans:

    WebDriver offers the users a very efficient way to handle these pop-ups using Alert interface. There are the four methods that we would be using along with the Alert interface.

    • void dismiss() – The dismiss() method clicks on the “Cancel” button as soon as the pop-up window appears.
    • void accept() – The accept() method clicks on the “Ok” button as soon as the pop-up window appears.
    • String getText() – The getText() method returns the text displayed on the alert box.
    • void sendKeys(String stringToSend) – The sendKeys() method enters the specified string pattern into the alert box.

    Q91. Is it possible to achieve 100% automation?

    Ans:

    It is impossible to automate everything. Achieving 100% automation is difficult because there are some scenarios where a registration page has a captcha or some test cases which we don’t execute often. By automating these types of test cases will not add value to the automation.

    Q92. Can we automate CAPTCHA or can we automate ReCAPTCHA?

    Ans:

    It’s not possible to automate CAPTCHA or ReCAPTCHA.

    CAPTCHA stands for Completely Automated Public Turing test to tell Computers and Humans Apart. The reason for creating a CAPTCHA is to control bots.If someone is capable of automating CAPTCHA then it means that the CAPTCHA is not able to tell computers and humans apart. So the idea behind CAPTCHA is failed.If someone is able to automate CAPTCHA then it’s not a CAPTCHA.

    Q93. What type of tests have you automated?

    Ans:

    Our main focus is to automate test cases to do Regression testing, Smoke testing, and Sanity testing. Sometimes based on the project and the test time estimation, we do focus on End to End testing.

    Q94. Name some popular automation tool that you are aware of?

    Ans:

    Some of the popular automation tools are Selenium WebDriver, QTP/UFT, JMeter, LoadRunner, Ranorex, etc.,

    Q95. What is Framework?

    Ans:

    A framework defines a set of rules or best practices which we can follow in a systematic way to achieve the desired results.

    Q96. How can we handle windows based pop up?

    Ans:

    Selenium is an automation testing tool which supports only web application testing, that means, it doesn’t support testing of windows based applications. However Selenium alone can’t help the situation but along with some third-party intervention, this problem can be overcome. There are several third-party tools available for handling window based pop-ups along with the selenium like AutoIT, Robot class etc.

    Q97. How to assert the title of the web page?

    Ans:

    • assertTrue(“The title of the window is incorrect.”,driver.getTitle().equals(“Title of the page”));

    Q98.What is Junit?

    Ans:

    Junit is a unit testing framework introduced by Apache. Junit is based on Java.

    Q99. What are some coding practices to follow while writing automation scripts or framework?

    Ans:

    Some of the good coding practices are:

    • Naming standards should follow
    • Comments should be added
    • Place reusable functions in a separate file
    • Avoid duplicate code
    • Add appropriate assertions

    Are you looking training with Right Jobs?

    Contact Us
    Get Training Quote for Free