Introduction
Most of the times the automated tests code can be divided in 3 phases: Configuration, Action and Verification.
This page shows how to prepare the environment of the Application Under Test and this falls in the Configuration phase.
By preparing the environment we mean taking care of the file system, database and more.
Environment backup and restore
Environment backup is the process of making an image of the initial environment. So imagine you have installed, configure and started your AUT, now as it is in a good initial state and you need to make an image. For example this might mean to remember some content on the file system and database.
Environment restore is the process of bringing the environment back to its initial state, so the next test can start safely. This means you need to restore some content of the local files system or database, or you need to restart some system process etc.
When is the environment backed up?
Usually right after installing and configuring your AUT.
It is possible to describe your environment in XML format and let ATS make an image of it.
When is the environment restored?
Usually right before calling your next test method.
Environment maintenance using ATS Agent
ATS comes with a library called Environment Cleanup which takes care of environment backups and restores, but usually the preferred way is to use this library silently i.e. without writing Java code but rather just describe the environment in some XML file.
Here are the details.
Environment maintenance using ATS Environment cleanup library
Here we show how to maintain the environment using Java code only.
Back to parent page
Go to Table of Contents