Validations can be used to validate execution response data of request items.
For example, you can define validation rule that requires response body to be equal to the exact text value and then use this validation rule with particular request item.
This will instruct HttpMaster to identify each execution as successful only if response body matches the text defined inside the validation rule.
It is also possible to create validation expression where multiple validations are connected with logical operators.
If you would like to use validations with particular request item, follow this procedure:
Open project properties from the main application menu or toolbar and switch to 'Validations' tab.
In 'Validations' tab, click 'Add new' button and then specify name for your validation.
Change definition of your validation in the right part of the window. In general, you have to specify type of response data on which execution should be validated.
All available validation types evaluate to true or false during the actual execution.
When you have completed your validation definition, click OK button to apply project properties. Your new validation is now created and stored inside the project.
Select request item in which you would like to use project validations and open it for editing (menu option 'Edit Items').
Inside request item switch to 'Validation' tab.
Create validation expression for request item by manually typing validation expression; all used project validations must be enclosed in curly braces. Alternatively, you can press 'Ctrl+Space' when inside the field to display a list of available project validations or 'Ctrl+Shift+Space'
to display list of available validation operators.
Apply changes to your request item. Executions of this request item will now always be evaluated according to your specified validation expression.
How to rename project validations
Validations can be renamed anytime in project properties. If renamed validations are in use in some of the request items, this rename will be reflected immediately in request item definition
after project changes are applied (request item validation expression will be updated with new names).
Even if request item is currently opened for editing in its own tab, validation expression designer and text field are updated with new names immediately.
Copyright © by Borvid. All rights reserved.