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.
Extract steps to create a routine from a trace
1. Select where to start extracting steps
In the Editor, select START ROUTINE where you would like to start the step extraction.
2. Select where the extraction ends
To select which steps go to the new routine, select END ROUTINE at end for the extraction.
3. 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 previous selected steps are now replaced by the new routine that you just created. You can open the routine from the step by clicking “edit”.
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 parents name tab - in this example ‘Register’.
Add a routine as a step
You can run routines in 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 add routine to open up the options for adding a routine step.
2. Select the routine you want to add
In the Pointer’s add routine tab, from the drop down list select the routine you want to be run in your trace.
3. Add the selected routine
Finally, click ‘Add’ to add the selected routine into the current trace.