Table of Contents
How To Do Automation Testing On An Existing Web Application: Introduction
Let’s imagine that you have a Legacy application (web applications) you need to change. Of course, it has never been tested, and you should write the test before starting to work with the code.
Should you start with web testing? But this is time-consuming, and there is never enough time in the software development. Perhaps, you’d rather start with security testing or performance testing that helps you to cover the most critical issues? Or maybe it’s better to write unit tests since they are faster?
Working with legacy code is a non-trivial situation. In this article, we will consider the possible variants (test cases) on how to do automation testing on an existing web app and decide which of them are better in certain situations.
What is a legacy system?
A legacy system (web applications) is a software written with the use of old methods and technologies that operates without access to the Internet. 70% of corporate business applications are legacy ones. The statistics show that 60% of the IT budget is spent on Legacy system maintenance.
Legacy applications are maintained by very few people possessing the knowledge of the corresponding technologies and business processes. Usually, earlier versions of the software are used. The companies avoid upgrading the app since there is a risk that everything goes down.
Most of the legacy apps don’t have proper documentation, that makes it challenging to understand how they work.Mykhailo PoliarushCEO, ZappleTech Inc.
Given the above-mentioned factors, replacing web applications may be a risky affair. With existing technologies and test cases, migration may be possible, but it involves time, maintenance, and testing the application. Since the legacy software is mainly written without security testing or performance testing, it’s a good idea to start introducing it to the app’s work. Let’s consider, what can be done for legacy system modernization.
How to automate the website testing?
It is always challenging to write performance testing (or a usability testing) test cases for a legacy application for, maybe, mobile devices. From where to start? How much to automate? What is the best strategy for test automation? Besides, there is never enough time and money, so you can’t test each and every module.
To decide on the first steps, you need to put priorities:
- What are the most critical areas of the application?
- Which key functionality brings the most money to the company?
- What are the biggest risks for the app operating systems?
- If you could improve only one thing in an application, what would it be?
What you shouldn’t do, is retrospectively write the tests for usability testing that successfully function as a part of the system. However, we need a set of key scenarios that check the system end-to-end to ensure that future development and maintenance won’t threaten the system functionality.
How to start legacy app testing
Here are some guidelines that can be used for testing (include security testing or performance testing) and creating test cases an existing web app to find the key scenarios and a way to expand them.
1) Exploring
The first thing for you to do usability testing or compatibility testing is to get acquainted with the web app and its features. Start with exploring the structure of the website, its pages, the features and behavior of each one. For your convenience, you can present the website as a mind map. It will always help you to understand, how the pages are connected.
2) Gathering metrics
Analyze, how the web app is used by using the data of the marketing or analytics team. Most likely, your application has a tool like Google Analytics that is able to track user actions. This will help you to understand the user behavior and to figure out some common user journeys and build test cases.
This information is necessary to decide, which test scenarios we should automate first in order to get maximum value within the shortest time.
3) Key scenarios automation
Once you have conducted the research, start automating core scenarios of the web app by test cases. For example, a typical user path in an e-commerce app is:
Homepage –> Search results –> Product details –> Customer login / Register –> Payment details –> Order confirmation
For us, it is important to check if the chain is working well and the user test cases is able to place and pay the order. At this stage, we don’t need to check the page functionality in detail.
4) Increasing the feature coverage
Now we can expand the smoke regression pack to make the more extensive one. Let’s use our mind map and apply the state transition compatibility testing technique to build the scenarios and test cases.
First, we need to find the entry points of the operating systems. They could be a landing page, a product details page or a special SEO-optimized one. Once we identified it, we need to find the features the user interacts with (a drop-down box, a search line, a filling up the user details, clicking a link).
The next actions are as follows:
- Recording the initial state of the feature to test cases.
- Triggering the feature (some features will load the same page, but with different data, the other ones will transfer us to a different page). Here we check how the trigger is working.
- Once the state of the application changed, we make an assertion to check the new feature state and write to test cases.
Then, you can continue similarly on a different page or go to the initial state and interact with a different feature. Repeat the actions, until you cover all the important features in your mind map. This is the principle of web app testing.
Test automation strategy for existing applications
We have told you about the general principles of implementing database testing or, functional testing in a legacy web app. In this part of the article, we will speak about the test data, particular steps and tools on how to automate web application.
Step 1 – Static analysis
Static code analysis is a method of automatically examining the source code without running a program. It is performed at the earliest development stage before starting the database testing. Static analysis helps to find typos and code weaknesses and fix them at once.
Tools for static analysis include:
- Linters
Lint tool (Linter) is an automated checker of your code for programming and stylistic errors. Linting is a basic stage of static code analysis.
Linter can make the code more readable:
– put the necessary tabs, spaces, semicolons, brackets
– make a nice nested structure of tags
– put the styles from tags to the separate <style> block
– eliminate the odd spaces and blank entries.
Advanced linters can not only format the code but check the code logic test data, for example, to find dependencies that occupy memory, are but never used. Some of them can find potential memory leaks, circular dependencies, incomplete calls and clumsy classes.
There are many linters depending on your programming language. For example: ESLint, PC-Lint, Pylint, JSLint etc.
- Formatters
A code formatter parses your code and re-prints it according to the set of formatting rules.
– enforce the set maximum line length
– make sure you don’t confuse single and double quotes
– add commas at the end of each item
– fix other formatting issues
Code formatter doesn’t touch the code functionality, only formatting. Example of code formatter: Prettier.
- Type checkers
Type checkers are static tools that detect errors in rarely used code paths and optimize the code in test scenarios by adding features like auto-completion. It detects the data types that are used and makes the code work faster and use less memory with the help of compilation.
Static type checkers are able to verify that the conditions hold all possible variants of program execution. It eliminates the need to repeat type checking during each program execution.
Examples of type checkers: TypeScript, Flow.
Step 2 – E2E testing
We already know that it’s impossible to test each and every feature in the application (like a data integrity), especially in a legacy one. We need to highlight the most important scenarios and run the test of them. Here comes end-to-end testing.
The best way to start is to write a test that will run on production and cover the most important user flow (please refer to your mind map).
Once the most important user path is tested, write the test scenarios for additional ones. But, if you do not have such an opportunity, you have already done an important job by testing the main one.Sergey AlmyashevCOO, ZappleTech Inc.
Step 3 – Unit testing
Once the main user paths are tested, we go to the next type of testing. You know that unit tests are simple types of automated tests. The biggest challenge in testing an existing web app is that it’s hard to decide where to start.
To start unit testing, choose a single pure function in your application and set up all the tools you need to have it tested. Once it’s done, it will become easier to write additional testing.
Step 4 – Integration testing
Having completed the previous steps, you already have all the necessary tools configured, and you are ready to write new tests. Now you can focus on writing the integration tests.
In integration testing, different program modules are logically united and tested as a single group. The goal of integration testing is to check the connection between the modules, data exchange, and find out the bugs in their interaction.
What Are the Main Mistakes That Can Be Made When Providing Automation Testing on an Existing Web Application?
If the team needs to conduct web application test automation for an existing solution, experts may encounter difficulties. Primarily because they haven’t led a project from scratch, they lack access to the initial results of product analysis.
Issues can still arise even when technical documentation, test cases, algorithms, and scenarios are available. These issues are linked to the fact that testing methodologies differ significantly. However, the peculiarities of website automation testing are not solely limited to this.
Unclear or Misguided Concept
In certain cases, the project might lack a clear Product Vision, which poses obstacles to developers and QA professionals. Essentially, you’re tasked with launching web application testing without clearly understanding what and why needs to be verified. Working for the sake of work is counterproductive; the focus should be on achieving results that satisfy both the target audience and stakeholders.
To address this problem, it’s essential to work on the concept of the IT solution, establish its goals, and use them as a basis for initiating web application test automation.
Misunderstanding Project Priorities
“Find errors and bugs in the software because we’re not confident they’re absent” – this is a fairly common requirement from QA service clients. It lacks specificity, focus, priorities, values, and goals. This is a problem both in the early stages of product creation and in processes like maintenance and scalability.
To mitigate such issues, the proper solution would involve analyzing the software and independently defining test cases for web application test automation. Even if some bugs remain, you’ll be confident that critical issues for the target audience have been identified, localized, and addressed.
Incorrect Tech Stack
You might find yourself stuck when you join a project previously managed by another QA team. The reason is quite simple: the client insists on using the same toolkit as the previous team. This creates a dissonance. On the one hand, it’s a logical request, but on the other, it’s not necessarily correct. The effectiveness of the previous website automation testing approach is unknown.
In this situation, you have two options: either agree to work according to the established template or convince the client that their solution for web application test automation was ineffective.
What Is Not So Simple at First Glance in This Kind of Testing?
When you start working with a finished product, meaning you initiate a hypothetical website automation testing, there are certain challenges the team awaits. For instance, a lack of understanding of the concept that needs to be considered for software verification, the action algorithm, or the overall QA approach in this project.
The issue lies in the fact that there was a hypothetical team that had already tailored the processes to their needs. The effectiveness of their operations could vary, but if third-party experts from an automation testing company are hired, it might not be the best approach. We recommend paying immediate attention to several aspects of web application test automation and making decisions for further project actions based on the results of their analysis.
Structure of Web Application Test Automation
From individual to collective: the typical pyramid when website automation testing is conducted in multiple stages. Cases are formed for small tests that gradually integrate into a single End-to-End scenario. It would be great if this concept was applied throughout the entire QA process.
Your task in a project with a finished product is to rebuild the testing pyramid and verify all its components. During web application test automation, you will uncover errors whose roots trace back to the initial development stages.
Algorithms for Website Automation Testing
Chances are, you already have your own web application test automation algorithm. Ensure it aligns with the specific product and can effectively analyze it. Key note: use the project’s values as a foundation upon which you’ll test the IT solution.
This will enable you to set QA goals correctly and achieve maximum results.
Roadmap for Web Application Test Automation
Analyze the product and technical documentation before starting website automation testing, so you can devise a proper plan for verifying the IT solution.
Web application test automation, especially in later stages (maintenance), is a somewhat complex process considering the project’s scale and status.Mikhail BodnarchukCDO, ZappleTech Inc.
Therefore, you’ll need a roadmap to focus efforts on critical points, gradually shifting towards less important issues.
In-House vs. Outsourced Automation Web Application Testing: Making the Right Choice
We hope we don’t need to explain the cost of errors during website automation testing in the later stages. It’s quite significant, so it’s unlikely that the Product Owner (PO) can afford the risk of subpar QA.
The question lies in how to conduct the web application test automation process: using in-house resources or a dedicated QA team. Let’s compare the benefits of both approaches and select the optimal one.
Pros and Cons of In-House Web Application Test Automation
Let’s assume you already have an established QA team within the company. They perform their tasks excellently, regularly test products, and so on. But do they have the experience required for this particular project?
Advantages of working with in-house professionals:
- Knowledge of the product and its specifics.
- High motivation and result-oriented focus.
- Understanding of the target audience and project values.
Disadvantages:
- Limited skill set.
- Costs of maintenance and technical support.
- Lack of experience.
A decent option for ongoing tasks or small projects within the context of a larger goal.
Pros and Cons of Outsourced Web Application Test Automation
Typically, outsourcing provides access to a wide range of diverse talents. You can find experts of any profile and even save on their hiring.
Advantages:
- Strong knowledge base.
- Multi-faceted experience.
- Relatively lower cost.
- Minimal additional expenses.
Disadvantages:
- Language barrier (possible).
- Somewhat challenging progress monitoring.
- Difference in activity hours.
When working with external experts, usually, the disadvantages can be mitigated. Therefore, considering the financial and expertise aspects, working with outsourcing teams is an ideal option for both SMBs and corporations.
Tips for Choosing a Good Contractor
You don’t need to sacrifice your time, budget, and nerves when choosing a contractor for your project. We’ve prepared a short guide to help you quickly find an expert performer with minimal expenses.
Setting Priorities and Budget
Regardless of how top-notch a QA service company is, don’t spend your entire budget hiring them. Considering the industry’s specifics, you’ll need additional services in the future. So, focus on current priorities and a reasonable provider’s price.
Trust us, it’s the best solution if you have a limited budget.
Finding Experts and Evaluating Their Experience
We recommend relying on platforms like G2, TrustPilot, etc., where clients post reviews about the work of specific teams. From there, you can learn whether the company works in your niche and how well it performs the assigned tasks.
However, this is just the initial stage; you must communicate with their representatives afterward.
Portfolio Review and Interview
Visit the team’s website and evaluate their portfolio. Check for case studies that match your niche or software type. If you’re satisfied with what and how the company is doing, arrange communication with managers, team leads, etc.
This is the only way to determine if a certain contractor suits your project.
Why It’s Better to Order This Kind of Service from ZappleTech
If you don’t want to waste your time and nerves, you can take advantage of the web test automation services from ZappleTech professionals.
For over 10 years, our team of experts has been executing QA projects for nearly all regions of the world, business industries, and client budgets. This is your chance to receive quality assistance with minimal expenses.
Need a preliminary consultation? Contact a company manager and discuss the collaboration terms!
How To Do Automation Testing On An Existing Web Application: Conclusion
With all this pressure of work and deadlines, automating the existing application can be difficult and daunting. Our team can partner with you to take this process into our hands. Contact us to book a free consultation with our specialists.