|User Guide / Actions|
While TestArchitect offers a library of hundreds of built-in actions for you to build your tests from, you will often find it necessary to create your own actions. Two types of such custom actions are possible: user-defined actions and user-scripted actions. Of the two, user-defined actions have the benefit of being the easiest to create, requiring no special skill level beyond a basic understanding of TestArchitect test authorship. They are also more convenient and faster to write and incorporate into your tests.
It is often the case that a given sequence of action lines performs what can be considered a single, well-defined function. Often this function must be repeated throughout a test, or across tests in a project. In such instances, it makes sense to embody, or encapsulate, the sequence into a user-defined action. In place of each instance of the action line sequence, only a single action line, one that invokes the new user-defined action, is required.Sometimes instances of action line sequences differ only by the data values they operate on. In such cases, the user-defined actions that replace them can handle the variability of data values through the use of arguments.
A user-defined action is comparable to a function, complete with arguments that can be passed to it to control the action’s behavior, as well as arguments that allow the function to return values to the calling entity. By calling on a user-defined action, a test module (or other user-defined action) executes a number of steps relating to a particular function or activity while isolating itself from all of the individual actions involved. Letting user-defined actions do low-level work enhances the readability of test modules, especially when the actions are well-named and their purpose is clear.