How to improve Automation execution efficiency ?

Lakshmanan Chellappan
2 min readMay 29, 2023

Automated execution run time and pass percentage are the key metrics to monitor and improve continuously as your automation suite grows. Both these metrics go hand in hand. One can ascertain faster feedback only when these factors are in an acceptable range for the project.

What are the different techniques to improve this ?

  • Atomic Tests — Make sure the test cases are written to test a specific functionality. Avoid grouping multiple tests in a single test case. E2E test cases are great. But you should make a wise decision here to manage it.
  • Self-Sufficient Tests — Avoid interlocking your tests by adding more dependency on the external factors : other tests, configuration changes done by other tests , data created by other tests etc..,
  • Intelligent Wait mechanism — Based on tool sets used for automation, make use of intelligent mechanism to wait for elements / events before failing a test. For instance with Selenium — make use of Explicit , fluent waits. Implicit wait mechanism might impact the enter suite- use it wisely. Avoid Hard waits.
  • Garbage collection — Make sure all the resources utilised in the script are tear down properly before moving on to the next Test case or at the end of suite.
  • Test Infrastructure — Infrastructure for executing tests plays a vital role in execution run time. Make sure below factors are considered,

Parallel / Grid Execution

Containerised Execution

Headless Execution

  • Test Data Management — Handling data plays a key role in optimising the run time and improving the pass percentage. This is a broader topic on its own. However , below key things that could be done in first instance to improve automation efficiency.

Data refresh : Have initialisation script ( by collaborating with the developers) to bring back the test data to desired state and make sure to run it before triggering the automation suite.

Data mining : Make the most to mine existing data in the environment and use it for automation scripts. Simple SQL scripts or other scripts based on your technology to fetch the data from the system and put it into a json / yaml / csv etc., and then refer these files from your automation script.

Data creation : Use SQL scripts / batch files to create data beforehand and utilise it in the automation script in the similar fashion as done in data mining

Faker Library: Use faker libraries to create dynamic test data like name, mobile no, address etc.., during the course of execution

--

--