Tips and Hints for Developing Automated Test Scripts

[article]

address when problems occur. Some test scripts are business critical and might run as batch jobs in the middle of the night. The proper and successful execution of these business critical test scripts can serve as a dependency or pre-condition for other automated tasks.

Always include logic in business critical test scripts that automatically sends notification in the event of a failure.

Documentation
To make test scripts reusable and easier to maintain, document all relevant information for executing the test script, a test script header, and any special conditions for execution of the test script. For example:

  1. Adjust dates within the application under test for closing of the books,
  2. Update any fields that require unique data,
  3. display settings for context sensitive/analog/bitmap recording,
  4. List other test scripts that are dependencies,
  5. Specify necessary authorization levels or user roles for executing the script,
  6. conditions under which the script can fail and work around for re-launching the script,
  7. Applications that need to be either opened or closed during the script execution, and
  8. Specific data formats, for instance, European date format versus US date format, etc.

Furthermore, scripts should contain a header with a description (i.e. what it is used for) and its particular purpose (i.e. regression testing). The script header should also include the script author and owner, creation and modification date, requirement identifiers that the script traces back to, the business area that the script supports, and number of variables and parameters for the script. Providing this information in the test script header facilitates the execution, modification, and maintenance of the script for future testing efforts.

Perform Version Control on Test Scripts
Many corporations spend tens of thousands of dollars for test tools, but ignore the by-product of the test tool -- namely the recorded test script. For companies building libraries and repositories of automated test scripts, it is highly advisable to perform version control on automated test scripts. Version control helps to track changes made to the test scripts, and to maintain multiple versions of the same test script.

Adhere to Test Script Naming Standards and Storage
Test scripts should follow the project's accepted naming standards and should be stored in the designated repository such as a shared drive or test management tool.

The test manager should designate naming standards for the test scripts that include information for these areas:

  1. Project name (i.e. GSI which stands for Global SAP Implementation),
  2. Release number (i.e. version or release number that will be released/deployed,
  3. Subject area or test category (i.e. SC for Security Testing, LT for Load Testing),
  4. Sequential test case number, and
  5. Title or function that will be tested (i.e. procurement from external vendors).

Following these tips enable testers to build more robust test scripts for their organizations. Also, developing maintainable test scripts maximizes the benefits of automated test tools. Companies can realize ROI from automated test tools when automated test scripts are used for future testing efforts, reducing the time needed to complete a testing cycle. The techniques above will help companies build test scripts that will meet these objectives.

About the author

Jose Fajardo's picture Jose Fajardo

Jose Fajardo (PMP, M.S., and SAP certified) has worked as a test manager for various companies utilizing automated testing tools. He has written and published numerous articles on testing SAP and authored the book titled Testing SAP R/3: A Manager's Step by Step Guide. Throughout his career Jose has helped to create testing standards and test plans, mentor junior programmers, audit testing results, implement automated testing strategies, and managed test teams. Jose can be contacted at josefajardo@hotmail.com.

AgileConnection is one of the growing communities of the TechWell network.

Featuring fresh, insightful stories, TechWell.com is the place to go for what is happening in software development and delivery.  Join the conversation now!