Follow My Step-By Step Process For Test Automation
Hi,
Today, I bring an all important newsletter that unveils my step-by-step process to harness the full potential of automation testing.
Follow my steps to fast-track your testing efforts, boost productivity and elevate the quality of your product.
Of course, you will delight your customers.
Advantages of Automated testing when done right
As you know, automated testing has many advantages if properly analysed and executed
It has a great potential to quickly execute the scripts. Repetitively. N number of times, tirelessly.
It follows the mantra- “Build once, execute many times”
You might have observed that execution of regression manually would take hours. But if you have scripts, you can complete them within minutes.
Here I have listed the advantages of automated testing:
Consequences of Automated Testing When Done Wrong
Automation should be treated as a separate project and can not be a part-time activity.
It creates havoc when done without proper analysis and planning.
There can be great monetary loss and waste of time.
Here, I have listed the consequences when automation strategy goes wrong.
Step-By-Step Process For Automated Testing
As I mentioned earlier, ‘automation’ is to be treated as a project.
It should have proper planning, budget, risk management, resources etc.
I am not getting in to details in to budgeting, risk management and other organisation level tasks.
However I will deep dive in to technical aspects of automation process.
That is what is needed by you . I hope.
Let’s start.
Here are the steps, which I follow for successful test automation.
Let’s dive deep in to each of these steps:
Ask the question “Why are we automating test cases?”
In a journey, I should know what is the destination. And the path to reach there.
Automation is a journey.
Understanding the purpose and benefits of automation is important. It helps me to make informed decisions and set clear objectives for your automation efforts.
It can save time, increase efficiency and improve overall software quality.
Remember that, there is investment involved in automation.
So one of the main goals should be to achieve the return on investment as quickly as possible.
Automation can be done with the aim to increase test coverage, shorten testing cycles, find bugs as early possible etc.
By having a clear understanding of the goals, you can better plan and execute your automation strategy.
Feasibility analysis
This one is super important.
In test automation, I should know what to automate.
As you know, everything can not be automated.
To answer the question-’What to automate ?’ I do the feasibility analysis.
In feasibility analysis I shortlist the test cases which are the best candidates for automation.
My high level criteria for best candidates are :
This analysis helps you identify which test cases are suitable for automation. And helps ensuring that your automation efforts are focused on areas that provide the most value.
Tool Selection
Tool selection is a critical decision in test automation. There are various automation tools available, each with its own features, capabilities, limitations and learning curve.
Some of the major tools are : Selenium, HP UFT, Karate etc.
I evaluate different tools based on my project requirements, technical expertise and budget.
Some organisations prefer open source tools, but others licensed tools.
I look for the factors such as ease of use, compatibility, support available for the tool and community resources.
I check if a particular tool can identify/locate the UI objects. The most, the better.
This helps you to choose the right tool, which is essential for efficient and successful automation implementation.
Develop/Select Framework
A framework provides us structured approach and guidelines for organising, managing and executing automated tests.
It includes reusable components, libraries and standardised practices.
We can develop a custom framework or adopt an existing one based on your project needs.
Based on my project requirement, I select Keyword Driven or Data Driven or Hybrid frameworks.
Based on this, I use Cucumber or any existing framework.
Or if available frameworks do not match the requirement, I develop own framework.
I can also tweak existing ones.
A well-designed framework promotes maintainability, scalability, and consistency in your automation efforts.
领英推荐
Based on your project requirement, you can select the tools and framework.
Decide reporting format
Reporting format is crucial to effectively communicate the results of automated tests.
I analyse what information stakeholders require and how they prefer to consume it.
Then I determine the metrics, logs and reports needed to track test execution, identify issues, and assess the overall test coverage.
I have the option to custom develop HTML report or Excel report or use existing reporting libraries like Allure reporting.
Execution report can be at summary level and can be detailed step-wise report.
A clear and informative reporting format helps you in understanding the test results and making data-driven decisions.
Proof of concept
Before fully implementing automation, I conduct a proof of concept (POC).
A POC involves implementing automation on a small scale to demonstrate its feasibility, effectiveness, and potential benefits.
It helps me to identify potential challenges, validate the selected approach and gain stakeholders' confidence in automation project.
A successful POC provides valuable insights and helps refine the automation strategy before scaling it up.
Here I use the already built frame work and tool to prove that, so far I am good on the automation journey.
If anything goes wrong, If I see any challenges in tool or framework, I pivot and look for other alternatives.
So, remember to do POC before you start automating scripts.
Pilot Project
Pilot projects serve as a controlled introduction of automation in real-world testing scenarios.
This is where I begin real implementation of automation project.
I select a subset of test cases and develop the scripts for them. Then execute them.
This allows me to observe the effectiveness, efficiency, and reliability of your automated tests in a production-like environment.
Pilot projects help you identify any gaps, fine-tune the automation process and gather feedback from stakeholders to ensure a smooth transition to full-scale automation.
Development of scripts
The real fun begins from here !
I write writing the code also called as script that automates the test cases.
Depending on the chosen automation tool, I use the scripting language or the GUI of the tool itself to create automated test scripts.
Depending on tool frame work, I write the script in Java or Python on VBScript.
You need to focus on writing clean, modular and maintainable code that accurately represents the intended test steps and validations.
Don’t forget to add comments wherever required in the code.
Testing of scripts
I have developed some code. It needs to be tested now.
Testing of scripts is an important step to verify the functionality and accuracy of your automated tests.
I execute the scripts on Application Under Test (AUT) and compare the expected results with the actual results.
I provide positive data, negative data as inputs and check if script can handle all situations and capture any errors.
I execute them as much as possible to make sure they are consistent.
Debug and troubleshoot any issues that arise during the testing phase. Thoroughly testing the scripts ensures you that they perform as intended and provide reliable results.
Execution of scripts
Once I get the confidence that scripts are working as expected, I start executing them regularly.
I monitor the test execution, capture logs and record any failures or issues encountered.
Regularly execute the scripts to ensure the stability and reliability of the automation suite.
Maintenance of scripts
Maintenance of scripts is an ongoing process in test automation.
As the application evolves, test cases change. So do the automated scripts.
New technologies may be introduced in the product. Therefore it's important to update and maintain my automated scripts.
I regularly review and modify scripts to accommodate changes in the application under test.
I also keep track of any test case modifications and update the automated scripts accordingly.
Maintenance ensures you that your automated tests remain accurate, relevant and effective over time.
Framework optimisation
Framework optimisation involves continuously improving the efficiency and effectiveness of your automation framework.
I regularly identify areas for optimisation, such as reducing script execution time, enhancing error handling, or improving reusability.
I might learn about a library, if used can save 100s of lines of code. I try to incorporate that library in my framework.
Regularly evaluate and enhance your framework to streamline automation processes, enhance test coverage and minimise maintenance efforts.
Optimisation helps maximise the benefits of your automation efforts and ensures long-term success.
Traceability for automated scripts
Though I mentioned it as a last step, it is important step.
It is an ongoing activity.
I maintain a file which will map the automated script to manual test case.
Traceability for automated scripts is essential to establish a clear connection between the test cases and the corresponding automated scripts.
It also facilitates effective reporting and auditability of the automation process.
Thant’s all for now !!
Conclusion
I have tried to outline my steps in automating test cases.
As a software tester, test automation requires continuous learning and improvement. Embrace the iterative nature of automation, gather feedback from stakeholders and stay updated with industry trends and best practices. With proper analysis, planning, and execution, test automation can significantly enhance your testing efforts and contribute to the overall success of the software development lifecycle.
Treat automation as a project and not a side task.
Reasoning subject
1 年Love this