Static Solution:
The first solution involves disabling the result recording option. To do this, follow the steps depicted in the image below:
- Select the step to exclude in the results.
- Click on Properties
- Navigate to Run Options
- Click on Result Recording Option
- Select Disabled from the dropdown menu.
This method is static, meaning the result recording option will be disabled for the entire sequence. This method won't be adequate if you only want to delete the result under certain criteria.
Dynamic Solution:
The second solution is dynamic and involves deleting the last step result using a statement. The procedure is explained in the following image and steps.
- Create a new Statement step after the step that you want to remove from the Result List.
- Select Expression
- Add the following statement:
SetNumElements(Locals.ResultList,GetNumElements(Locals.ResultList)-1)
Optionally, add a condition to decide when to exclude the step in the results.
- Navigate to Properties.
- Select Preconditions
- Write a Precondition Expression, for example, to exclude a failed step in the Report List, use the statement:
RunState.PreviousStep.Result.Status=="Failed"