Accelerated Automation - Need of the hour
Anil Upadhyay
Software Quality Assurance Specialist @ Synechron | ISTQB Certified, Test Automation Foundations
As the script base of the automated tests increases, it also impacts the waiting time to get the test results and can be annoying to the business and stakeholders. Then we start asking questions - Are all scripts we run useful, should we reduce execution time, and so on….
Focussing on the following areas will help us reduce execution time and give faster Go/NoGo status to the delivery process.
Let's start with small steps:
- Focus On Automating Right Things: Focus should be on testing functionality and limited instruction, help text, and toast messages. Including all the contents of the web page, I test automation is not a good practice. Testing the contents of the webpage comes under another discipline called Content Testing. Separate the contents from functionality. Include only those contents that are dynamic. Avoid creating automated tests around low-value feature or feature that rarely changes.
- Smart Clustering Of Test Scripts: Suppose you have 100 test scripts and after repeated test runs you come to know that 20 of your test scripts takes longer than anticipated time to complete the run and you name it as batch A, the next 50 takes acceptable time and you name it as batch B and the remaining 30 takes considerably less as compared to the others and you name it as batch C. Now a smart way of handling is to shuffle the test scripts, take out few test scripts from batch A and replace them with the scripts in batch B, and so on… This will help to balance the amount of time each batch takes and we will get the result at one go from all three batches. We would not have to wait for batch A tests to complete consuming the maximum, unreasonable amount of time.
- Chop The Long Uses Cases: When we talk about the E2E user journeys, some of them might be very long journeys. So it will be better if we chop the longer user journeys to smaller journeys but keeping in mind that the stoppage of each journey should end in such a way that the state should be assertible. You might be thinking now why am I asking you to follow this approach: The answer to the question is that although there are very good automated testing tools available, however, when it comes to testing longer journeys you may face hiccups in the application user test which can be because of network issues, third-party APIs being slow resulting in delayed response, “ensureCleanSession” set to True thereby the cached pages not available.You may face failures in automated test runs but not when you are executing the long journeys manually. So better to have small user journeys.These focus on just one piece of application functionality and are much faster and easier to execute than longer tests assessing multiple pieces of functionality.
- Maintain Test Independence As Much As Possible: One of the factors that hinder parallel execution is test dependency. Tests should be independent as possible.
- Efficient Locator Strategies: Using complex locators can impact the test execution. So it is better to go to the developers and ask them to add the ID, NAME. Listed below are the Web Locators in ascending order of the execution speed: ID>NAME>CLASS>CSS>XPATH
- Avoid Thread.Sleep() At Every Cost
- Use Explicit Waits
- Use The Power Of Parallel Execution
- Use Virtualization: utilize virtualization to create multiple environments, or create on-demand containerized execution environments in the cloud based on Docker with Kubernetes and have multiple batches runs that way.
Happy Testing
Experienced QA Tech Lead | 12+ Years in Automation Testing | CSM & ISTQB-CTFL Certified | Driving Quality at Cigniti Technologies
3 年Loved it.