Our Customers typically have 4-7 “lower” environments where the underlying application is deployed and tested, multiple times by multiple teams before making it into “production”. One of the big benefits of using Awetest is the ability to create and test new environments on the fly using existing scripts. When an automation script is written, it is typically done against an environment such as DEV. What happens when that same automation script wants to be run against a different environment or if the initial environment changes? Most likely, you will need to edit your script to accommodate for any DOM changes.
We recently had a customer do a huge backend change and they wanted the automation scripts to be run against the new environment. All the workflows and business logic were still the same so we knew we could do a quick smoke out of their new system. However, what they didn’t tell us was that their backend change would re-factor the DOM values for radio buttons and checkboxes.
Luckily we had anticipated this scenario and were prepared with MS Excel based “object maps”. We’ve seen hard-coded DOM identifiers in test scripts in the past, and if we didn’t have “parametrized” scripts in place, we would have to manually go through hundreds of test scripts to map the new DOM values.
This would have been a tedious and time consuming task.
The idea of parameterizing your automation scripts is that you will define all your variables beforehand and apply the same variables to the relevant scripts.
What this means is instead of writing a set radio action like:
@radio_value will be defined as the appropriate value (1256) either in an excel sheet or even a simple set variables method. The variable @radio_value will be used across all the automation scripts and any change to that variable will impact the complete suite of test scripts.
If automation scripts are written with parameterized variables, it makes them easier to maintain and would lend to quick test script creation which will be discussed in a future blog.
ABOUT THE AUTHOR
More posts by awoo