Reusable trace design
Use routines in your traces to ease the maintenance work needed when your website changes. For example, many traces may need to login to your website before testing the other features. In this case, it’s useful to share the common login test logic among all traces that need to login.
In Usetrace, common trace parts can be reused. When recording a trace, you can extract steps to create a routine. After extraction, the steps will be replaced by a routine that performs the routine when the trace is run. This new routine, with the extracted steps, can be added to other traces as well.
To add a routine: 1) Extract steps from an existing trace to create routines and 2) add routine steps to use existing routines in new traces.
See also how to use parameters.
Create a routine while Recording steps
1. Record steps
While using the Recorder, multiple steps can be saved as a routine directly instead of separate steps. Give a name to the routine you want to save.
2. Saved routine
The routine is saved as part of the parent trace and can be opened and its steps viewed separately as well.
Extract steps to create a routine from a trace
1. Select where to start extracting steps
In the Editor, select multiple steps to create a routine.
2. Give a name to the newly created routine
The selected steps will now be extracted to a new routine. Give a name for the new routine.
4. Optional: navigating to a routine
The previously selected steps are now replaced by the new routine that you just created. You can open the routine from the step by clicking on the button.
5. Navigate back to the parent trace
When you have navigated to the routine, you can navigate back to the parent trace by clicking the parent's name tab - in this example ‘Register’.
Add a routine as a step
You can run routines at any point of your trace by adding them to your trace.
1. Go to the routine step option in the Pointer
In the Editor, click the Pointer’s middle tab to add a routine to open up the options for adding a routine step. In the Pointer’s add routine tab, from the drop-down list select the routine you want to be run in your trace.
2. Add the selected routine
Finally, clicking on the selected routine adds it to the current trace.