Best Practices for writing custom actions
In ATS there are two ways for creating custom actions. First you can extract actions from you test case steps, to encapsulate multiple test steps into a single test step. The second way is to create custom actions from scratch. This section provides you with Do’s and Dont’s for your custom action creation process, to help you achieve the actions you want.
Write reusable and focused actions
Use input parameters and generic functions instead of hardcoding every variable or option. Also don’t write actions that do everything at once. Let your actions do one specific task, e.g. the retrieval of a WebElement. This serves the readability of your actions/test cases and also makes maintenance much easier.
Always use descriptive names for your actions and parameters, e.g. “Set TextBox value” for an action or “Column Name” for a parameter. This makes it easier to know what your action does, without looking into it.
Some parameter names used by the ATS core library:
- Widget Name
- Column Name
- Column Value
- Page Title