Grouping Steps Using Custom Actions
Package a repeated sequence of steps into one reusable custom action.
Grouping Steps for Reuse
In programming, the principle of "reuse" involves avoiding repetitive tasks by placing them in methods that can be called whenever needed, rather than copying and pasting the same code multiple times.
This principle applies similarly in automated testing. By grouping steps together into reusable components, you can call a particular custom action (reusable component) in different tests. This helps in reducing the number of steps visible in the script.
Example 1 - User Authentication Scenario
Consider a scenario where you need to authenticate a user using a custom action. This action includes:
- Enter username
- Enter password
- Enter captcha
- Click submit button
These steps can be grouped together into a custom action (reusable action) named 'Log into the ecommerce website'. This custom action can then be called in the Record Scenario and Edit Scenarios features. For more details on usage of custom actions, click here.