Parallel Execution of Selenium Scripts in Azure Virtual Machines for Efficient and Speedy Results


Summary

As more and more companies use automation suites in an effort to meet 100% coverage for better and effective testing, a common concern that every team has is ‘How to reduce the long execution time and reap benefits at the same time’. With the traditional sequential execution approach, automation script execution takes longer time to complete and this time keeps increasing with an increase in the number of test cases. Hence, the sequential execution approach is not an ideal option to meet the requirements of continuous development and delivery model. In this article, we are describing a solution with an intent to execute each and every test case (not just Sanity) and still get faster feedback through ‘Parallel Script Execution’.

Technical Solution Vs. Mindset:

For optimal usage of test cases in parallel execution, during the test definition stage test cases must be created as independent as possible even in the integrated environment. Moreover, grouping of test cases must not be sequential and rather be performed on the module basis. 

How To Achieve Parallelism : 

Technical Insight– Parallel execution is dependent on the configuration that is made. Test agents for execution need to be created and these agents should be added to an agent pool. Releases for triggering the execution should be created with Agent job configuration as ‘Multi agent’. Additionally, VS Test assemblies should be updated with option ‘Based on Agents and Tests’. After Release creation, the tests will be discovered and distributed against the test agents for execution. The execution time can further be reduced dynamically based on the count of available virtual machines (VMs) in the respective agent pool. 

VM Management and Cost Control:

  • By implementing PowerShell scripts to start and stop the VMs, usage of VMs will be controlled.
  • Thus, the billing of VMs can be controlled as well based on the CPU utilization. 

Conclusion:

Parallel execution will help  in Significant reduction of execution time for big automation suites, produce Quick results for every build validation and helps in inclusion of automation in CICD.

Parallel execution using virtual machine’s will accelerate the phase of test automation, dynamic scaling of virtual machines will further get the execution time down. Cloud/Azure learning and implementations opens the scope of learning as well as standard of test automation with better and efficient utilization of Automation scripts.

Leave A Comment

Your email address will not be published. Required fields are marked *