Do you want to learn automation testing but don’t know how to begin? Let us guide you through the basics of automation testing along with the whole test automation process.
In this tutorial, we will study – what, how, when, and why of automation testing. During this tutorial, we will get to know some of the most popular test automation tools that you can pick for learning, based on your skill-set and the project requirements.
Skip to our tutorials on automation testing tools directly.
What is Automation?
Before starting with Automation Testing, let’s first understand the term – “automation”. Automation is a process using which we can automate a manual process with the use of technology. The aim is to eliminate or reduce human/manual effort. Now let’s see, how automation helps in software testing.
Testing a software includes writing test cases once and then executing them again and again, whenever required.
The test execution, when performed manually is a very time consuming and tedious task. Automation testing helps in reducing the test execution time as the test scripts written once, can be run automatically any number of times without any human intervention.
What is Automation Testing?
Automation testing is a type of software testing that involves automated test case execution using an automation tool.
So, basically it automates the manual testing process. The tester writes test scripts and then run the test scripts either on-demand or schedule them for periodic executions. This reduces the overall testing time, thus helping in faster product releases.
What to Automate?
Now that we know what exactly is Automation testing, let’s check which test cases to automate or what all test cases are ideal candidates for automation.
- Test cases that test critical functionality of the application – For example for an e-commerce application, the critical functionality would be the product discovery via search and category pages, add to cart and then buy functionality. So, these test cases should be first chosen. Test cases for add to wishlist and notify me etc should be of lower priority and hence picked accordingly for automation.
- Test cases that require repeated test execution with a large dataset – There are many test cases or application flow that require performing an action again and again. Such test cases are also ideal candidates for automation as once automated, a considerable amount of testing effort gets reduced.
Take an example of a search feature of an application. If we can automate the flow to search with a search term and then verify that search results. Then the same script can be run again and again with a different type of search terms like – single word, multi-word, alphanumeric, with special characters, with foreign language characters, etc.
- Tests that are time-consuming – Workflows that require a considerable amount of time to execute and setup should also be ideal candidates for automation.
Taking the example of e-commerce application forward, if some test cases require the set up of multiple products and then performing some operation on those products. Such test cases when automated not only reduce the test execution time but also, free the manual testers of the redundant task and help them focus on other exploratory testing activities.
- Test cases that are required to be run in parallel or distributed environment – Some test cases that require performing of concurrent operations on the application e.g. in case of performance testing or scenarios in which we need to check application behavior on simultaneous access to the resources. In such cases, either manual testing is not feasible or it would require a lot more resources to test the particular scenarios. Those automated scripts help by making concurrent requests and collating results in one place.
What not to Automate?
It is also important to understand, what sort of test cases cannot or rather should not be automated.
- UI related test cases – Test cases related to the Graphical User Interface should best be left for manual testing or human validation. This is because even with the slightest change in the UI, the test cases would fail and it is also very difficult to create reliable UI test cases across multiple devices and screen resolutions.
- Usability related test cases – Rather than ‘should not’ it is the case of ‘cannot’ automate. Usability related test cases, test application’s ease of use by different sets of users which, with the current technology is not possible to automate.
- Functionalities that are rarely used and take time for scripting – It is good to automate the complex scenarios but investing your effort on scenarios that would rarely be used doesn’t provide a good Return on Investment.
- Exploratory testing – Exploratory testing requires learning about the application on the fly and simultaneous testing. Hence, it is not possible to automate exploratory testing scenarios.
When should we Automate?
Once all the capabilities of the automation suite are defined during Test Planning, we can begin the automation framework creation activity in parallel with the development team. But the scripting of the test cases should be done at the right time.
For better automation ROI and to avoid any rework – scripting of test cases should be started when the application is stable and frequent changes in the application are not anticipated.
Why Automated Testing?
Following are some of the advantages or benefits of automation testing-
- Automation testing reduces the overall test execution time. Since automated test execution is faster than manual test execution.
- It reduces the cost and resource requirements of the project, as the script created once can be made to run any number of times as long as there is no change in the application.
- Helps in working with a large set of input which isn’t be feasible with manual testing.
- Helps in creating a Continuous Integration environment wherein, after each code push, automatic test suite execution takes place with the new build. Using CICD tools like Jenkins, we can create Jobs that execute the test cases after the deployment of a build and mails the test results to the stakeholders.
When not to Automate?
Let’s see some scenarios, where it is not advisable to do automated testing along with some disadvantages of automation.
- Lack of expertise of the automation tool – Lacking expertise in the automation tool and\or programming language required to create robust scripts is one of the primary reason which can lead to not using the tool to its full potential. Factors like these lead to the failure of automation testing.
- Incorrectly chosen test cases – Success of automation testing heavily depends on the test cases chosen for automation. Incorrectly chosen tests lead to wastage of resources and time invested in automation.
- Applications with frequent changes – Choosing test automation for an application with frequent changes requires constant maintenance of the test scripts, which at times might not give the desired ROI.
- Inefficiently written test scripts – Test scripts with limited or inadequate validations can lead to false-positive test results. These false-positive results conceal the underlying defects which could have been easily captured if validated manually or scripted in a better way.
Test Automation Process
The automated testing process includes all the set of activities that are performed during the automation of different software applications. We will learn each phase from the requirement understanding to the automated scripting and the CI-CD integration phase.
- Requirements understanding – Before starting with test automation, the first and foremost activity is to understand the requirement. The understanding of the requirement will help in defining the scope of automation along with a selection of the right tool.
- Defining scope of automation – Defining the scope of automation is finding the right test cases for automation. This would include all the types of test cases that fall under the test case types defined in the “What to Automate?” section of this article.
- Selecting the right tool – Tool selection depends on various factors like – the requirement of the project, the programming expertise, project budget (whether to go for the free or paid tool), etc.
- Framework creation – For creating robust test automation suites we need to create an automation framework. These frameworks help in making the test scripts reusable, maintainable, and robust. Based on the project requirement, we can choose among the different automation frameworks discussed below, in the section – Automation Testing Framework.
- Scripting test cases – After the automation framework set up, we start the scripting of test cases, selected for automation. A typical script for a web application test case looks like this-
- Open browser
- Navigate to the application URL
- Perform some actions on different web elements
- Post some data picked from external test data files
- Validation or assertion logic
- CICD Integration – Although we can run the test cases on demand but nowadays CICD – (Continuous integration and continuous delivery) is widely used in almost every product or service-based company. From a testing point of view, this involves setting up the test suites on a CICD tool like Jenkins.
Once set up, we can then schedule a nightly test suite run or on test cases on demand. But the major benefit of integrating the automation suite with the CICD pipeline comes when the test cases are automatically triggered for execution after the deployment. In this setup, in just one click, just after the deployment, the automation test suites check the stability of the build.
Test Automation Framework
While doing manual testing of any application, we define a set of rules like – the format of the test cases, the prioritization of test execution, the different practices to be followed in order to optimize the whole software testing process, etc. Similarly in the case of automation testing also, we make use of automation frameworks that help in reducing the automated script maintenance cost and improving the overall automation testing process.
The framework can contain guidelines and implementation of different factors that affect the quality of the test suite like-
- Where should we have the test data? – Hard-coded in the script or in some external files.
- How should we handle the object repository or the locators of the elements be automated (locators are the identifier of the different elements like – a textbox, a button, etc.)?
- Where should we keep the common functionalities that can be reused again and again? – To avoid redundancy and improve code-reusability.
- What should be the reporting format? – HTML, PDF, Xls, etc.
- How should we implement logging? – What tool/library should be used?
- What should be done in case of a test failure? – Should we take a screenshot or try to re-run the test case, etc?
To handle and implement all such practices, we develop an automation testing framework. Following are some of the most widely used automation frameworks-
- Modular framework – Modular frameworks are one of the basic automation frameworks in which the commonly used functionalities database connection, login flow, method to read data from an external file, etc are identified and created as methods. While scripting instead of writing the line of code, again and again, we simply call the reusable methods wherever required.
- Data-driven framework – In the case of data-driven frameworks, the test data lies in external files, and based on the number of rows on the external files, the test case gets executed multiple times with different datasets in each iteration (fetched from the file). Since the data is driving the automation, hence the name, Data-driven framework.
- Keyword-driven framework – In keyword driven framework, we can write test cases in plain text e.g. we can write test cases in an excel sheet in the below form-
Now the framework will already have the methods defined for each keyword used, like – there will be automation code for OpenBrowser keyword, NavigateTo keyword, etc. In this way, once the framework is set up even a non-technical user can create automation test scripts in plain-text.
- Hybrid framework – As the name suggests, it is the combination of multiple frameworks. So, a combination of any 2 of the above framework would be termed as a data-driven framework. Mostly when we say a Hybrid framework it relates to a Data-driven with keyword driven framework.
Myths about Automated Testing
Time to bust some myths surrounding test automation-
- 100% automation is possible – Barring a few very specific applications, 100% automation is just not possible. Exploratory test cases, usability test cases are some of the examples of the test cases that can’t be automated.
- Automation will eat the manual testing jobs – While it is true that with the advent and rise of automation testing and different tools, there is a shift to the requirement of full-stack or dual role testers – who can work on both manual and automation testing. But automation will never be able to completely eliminate the need for manual testing.
- Developer makes better automation testers – While a developer might have a slight edge on the coding part but still a tester will be able to think from a testing perspective and try to create more robust test scripts that will have multi-gate verification.
- Automation is expensive – When done correctly, automation can reduce the overall testing effort and resource requirement. Thus saving the project cost in the long run.
Popular Test Automation Tools
The software market is full of paid and free test automation tools. Based on the various factors like – project requirement, budget, the expertise of the resources, etc, we should choose the right tool, suited for our needs. The following are some of the most popular test automation tools in the market.
- Katalon Studio – A fairly new tool but rapidly getting popular due to record and playback features along with scripting for more technical users. It is free but not open source.
- UFT One – A paid tool by Microfocus that can be used for automation of both Web and Windows applications. It supports scripting in VBScript only.
- TestComplete – A paid tool provided by Smartbear which can be used for automation of Web, Mobile as well as Desktop applications.
- Tosca – It is a paid tool by Tricentis that provides record and playback features for automating web applications, APIs, and windows applications. It is considered as one of the most popular codeless automation tools that can completely eliminate the need for scripting.
- Watir – Watir (Web Application Testing In Ruby) is an open-source automation tool that can automate web applications in Ruby. It has a watir-webdriver component that is based on Selenium.
- Appium – It can be considered as Selenium for mobile applications. Just like Selenium, it is open-source and has a large user base.
- TestProject – TestProject is a free and community-powered automation testing tool by Tricentis. It can be used for the automation of both web and mobile applications.
- Ranorex – A paid tool with record and playback feature using which we can automate android, ios and Windows applications. Along with record and playback, it also supports scripting in using C# and VB scripts.
For more details, you can check our post – Top Test Automation Tools containing in-depth review, tool’s features, download link, and our recommendations of the different tools.
Our Free Tutorials
Now, that you have a fair understanding of the test automation process, you can select the right tool for learning automation. For this, I would highly recommend you to go through the post – Roadmap for transition from Manual to Automation QA. After that, you can check our below-mentioned tutorials on popular test automation tools.
I hope this article helped you in understanding the automation testing basics along with the understanding of all the activities performed in the test automation process. Now, you can start your automation testing journey with our popular tutorials.
Kuldeep is the founder and lead author of ArtOfTesting. He is skilled in test automation, performance testing, big data, and CI-CD. He brings his decade of experience to his current role where he is dedicated to educating the QA professionals. You can find him on LinkedIn.