Here are Automation Testing interview questions and answers for fresher and experienced candidates to get their dream job.
Automation Testing uses an automation tool to execute test cases. The main goal of Automation Testing is to reduce the number of test cases to be run manually and not eliminate Manual Testing.
Automation is preferred in the following cases
Testing is not recommended for one-off test cases. Usually, the decision on which test cases to automate is based on the ROI (Return on Investment). The more times the automated test is executed, the better the ROI.
One should not automate in the following cases
In the automation process, the steps involved are
During the planning phase of automation, things that must be taken into concern are:
Automation testing is not helpful for agile methods in the following conditions:
A test script is a code to perform a set of instructions on an application. It is used to verify whether the application is functioning as per the software requirements.
When you run your script, it gives the test results as a pass or fails, which is determined by whether the application works as per the expectations.
Here are good automation practices:
Modular Testing framework is built on the concept of abstraction. In this type of framework, the tester creates scripts for all the application modules under test, and then these scripts are combined in a hierarchical order to create test cases.
In Data driven testing framework, the input and expected output data corresponding to the input data is stored in a file or database.
The automated script runs the same test steps for multiple data sets. It also allows you to run multiple test cases where only the input data differs, but the steps of execution remain the same.
We use GitHub. Version control helps you to track code changes. It controls the test script source code with a recorded history of changes to simplify the modification process. You may also revert to previous code versions if you make a mistake.
XPath is a syntax that manipulates XML (Extensible Markup Language) data. They help to locate nodes related to those on the tree. Some important XPath Axes are ancestor, child, namespace, parent, etc.
Applications that require UI testing that interacts with multiple elements can slow down the testing process. It’s better to create a simple test script that speeds up test execution.
Documentation plays a vital role in Test Automation. You should document all the methods and procedures to ensure their repeatability. Test specifications, designs, code changes, test cases, automation plans, bug reports
Four types of frameworks used are
No, it is not possible to automate everything. Achieving 100% automation is difficult as there are some scenarios where a registration page has a captcha or some test cases we don’t execute often. Moreover, automating these test cases will not add value to the automation or bring positive ROI.
The answer depends on the length and complexity of the test scenario. Generally, a QA tester can automate 2-4 test scenarios daily when the complexity is limited. However, sometimes it might reduce to 1-2 when the complexity is high.
While writing the scripts for automation, you must consider the following things:
The most popular test tool for automation testing are:
Here is a complete list of automation testing tools.
Following criteria can map the success of automation testing:
Here are the differences between all:
A few important pre-requisites of Automation Testing are:
Frameworks are guidelines and not mandatory to create and execute automation scripts. So, yes, we can automate without a framework. Enhancing and maintaining test scripts would be easy if we created and followed a framework.
Selenium is a free (open source) test automation suite. It is used to automate Web and Mobile environments. It consists of the following.
QTP (Quick Test Professional) is now known as Microfocus UFT. It is a commercial automation tool and supports an extensive range of test environments: Web, Desktop, SAP, Delphi, Net, ActiveX, Flex, Java, Oracle, Mobile, PeopleSoft, PowerBuilder, Siebel, Stingray, and Visual Basic, amongst others.
The scripting language is VBScript. The tool gels well with ALM (Test Management Tool) and LoadRunner (Performance Testing Tool).
Salient features of QTP include Business Process Testing, keyword-driven framework, XML support, robust checkpoints, and test results.
SikuliX is a tool that uses the “Visual Image Match” method to automate the graphical user interface. All the web elements in SikuliX should be taken as an image and stored inside the project.
SikuliX is comprised of
Practical uses of SikuliX are:
SikuliX | Selenium |
---|---|
It provides extensive support to automate flash objects | It cannot automate flash objects like video players or audio players. |
It has a simple API | It has got complicated API |
It uses a visual match to find elements on the screen. So, we can automate anything we see on the screen. | It uses CSS, ID, locators, and other selected to identify GUI elements |
It can automate the web as well as windows application | It can automate only web applications |
Here are some important attributes of a good automation framework:
It is a subset of browser automation testing that helps you ensure that the online application operates correctly across different browsers. Google Chrome, Mozilla Firefox, Microsoft Edge, Safari, etc.
The main aim of cross-browser testing is to check that your website or web app works correctly on different combinations of browsers and OS.
You can use a Selenium framework for the following testing:
Automation testing is primarily black box testing.
Selenium WebDriver can help you find the current URL of a page with the getcurrentURL(). This method will find the URL of the open applications and result in a string.
URL, login, and password are important information used very often and change frequently. They should always be maintained in a separate file. If not done, then the automation tester must change it in every file with its reference.
Some Important Test Assets and extensions of QTP are:
Parameters | Manual Testing | Automation Testing |
---|---|---|
Time consumption | More | Less |
STLC | Follow manually | Follows using tool |
Cos | Less expensive | Expensive |
Reliability | Less Reliable | Highly Reliable |
Quality | Low | High |
Skill Set | Less skill set required | High skill set is required. |
Here are some essential modules of the automation testing framework:
Cucumber is an open-source (BDE) behavior-driven development tool. It is used tool for web-based application automation testing and supports languages like Java, Ruby, Ruby, Scala, Groovy, etc. Cucumber reads executable specifications written in plain text and tests the application under test for those specifications.
TestComplete is an automated UI testing tool for desktop applications, web, mobile, etc. It offers the flexibility to record a test case on one browser and run it on multiple browsers, thus supporting cross browsers testing.
Cypress is an open-source testing framework. It is developed in JavaScript and has lately gained popularity because of its simplicity and extensive capabilities that enable browser testing, and user manuals should be thoroughly documented.
Selenium gives alerts if there are issues while you test. The pop-up interface allows you to handle the alert by switching the control to the pop-up, pressing the OK or Cancel buttons, and turning back to the source page screen.
String srcPage = driver.getWindowHandle(); Alert pop = driver.switchTo().alert(); // shift control to the alert pop-up. Pop.accept(); // click k button.
The Hybrid Testing framework develops the test cases from modular scripts by combining them in the modular testing framework.
Here are the steps to automate basic login functionality:
Step 1) Understand the project requirement.
Step 2) Identify the Test scenarios
Step 3) Prepare a data input file with the data corresponding to each scenario
Step 4) Launch the tool from the program.
Step 5) Identify the username, password, and login buttons.
Step 6) Verify that the error message for negative scenarios is the same as the success message for positive test -scenarios.
These interview questions will also help in your viva(orals)