Introduction
In certain scenarios, you might need to process data. For example, you might need to automatically extract a number from a text. TheUtilities option is available in the Miscellaneous action.
Steps
- Add a new step in your test.
- Select the
Miscellaneousaction from theActiondropdown. - Select the
Utilitiesoption from theAction Typedropdown. - Select the method that you want to use from the
Methoddropdown.
Methods
You can choose from different methods:1. Extract Text After Pattern
TheExtract Text After Pattern method can be used to extract a substring from a string, by providing another substring as a pattern.
Query Params that you need to add in the Send API Request modal:
For example, let’s say you have the following text:
1234 portion of that text by providing the following pattern:
3. Extract Numbers From Text
TheExtract Numbers From Text method can used to extract all the numbers from a string.
For example, let’s say you have the following text:
1234 portion of that text because it’s entirely made up of numbers.
4. Extract Value From JSON
TheExtract Value From JSON method can used to get a value from a JSON object.
For example, if you have the following JSON object:
5. Extract Item From Array
TheExtract Item From Array method can used to get an item from an array.
For example, if you have the following array:
Utilities steps which can use the Extract Item From Array and Extract Value From JSON methods to extract values from complex JSON objects.
For example, you might have a complex JSON object like this:
firstName value from that JSON object, you have to chain together 3 Utilities steps:
Start by using the Extract Value From JSON method to get the value for the employees item:
Extract Item From Array to get the second item from that array.
Extract Value From JSON method to get the value for the firstName.
6. Extract Last Item From Array
TheExtract Last Item From Array method can used to get the last item from an array.
7. Get Text Length
TheGet Text Length method can used to get the character count of a text.
8. Store Item in Vault
In some scenarios, you might need to manage values across different test suites. These use cases can usually be handled by using Variables and Import Test Case actions. But there are other scenarios where one test suite might update a value which is used by other test suites. You can use theEndtest Vault to store and fetch global values, which can be accessed from all your test suites.
It works like a permanent storage.
And these global values are called items.
The Store Item in Vault method can be used to store an item.
The items stored in the Endtest Vault can only be accessed by you and your Team.
The method requires entering the Endtest API credentials (App ID and App Code), which you can find in the Settings page.
9. Get Item from Vault
TheGet Item from Vault method can be used to fetch global values stored in the Endtest Vault.
These global values are called items.
The items stored in the Endtest Vault can only be accessed by you and your Team.
The method requires entering the Endtest API credentials (App ID and App Code), which you can find in the Settings page.
When the item is fetched from the Endtest Vault, the value of that item will be extracted into a variable.
The value will also be displayed in the Logs of the Results page for that test execution.
If you do not want the value to be displayed in the Logs, you’ll need to give the item a name that contains one of these 2 strings: secret or password (uppercase or lowercase or mixed). That can only be done when using the Store Item in Vault method.
10. Generate Random Name
TheGenerate Random Name method can be used to generate random names.
11. Extract Character from String
TheExtract Character from String method can be used to extract a certain character from a string.
12. Convert Text to LowerCase
TheConvert Text to LowerCase method can be used to convert a text to LowerCase.
13. Convert Text to UpperCase
TheConvert Text to UpperCase method can be used to convert a text to UpperCase.
14. Capitalize Text
TheCapitalize Text method can be used to capitalize a text, converting the first letter of each word to a capital letter (uppercase letter) and the remaining letters to lower case.
15. Send Email
TheSend Email method can be used to send an email from any endtest-mail.io address.
This feature is not available during the free trial.
If you want to also add an attachment to the email, use the Utilities API instead.
16. Math Calculations
TheMath Calculations method can be used to perform mathematical operations.
Supported operations: Addition, Subtraction, Multiplication, Division, Round, Round Down, Round Up.
You can perform math operations with variables by placing the variable name between double curly brackets:
{{$price}};{{$tax}}
17. Remove Newline Characters
TheRemove Newline Characters method can be used to remove Newline characters.
18. Trim String
TheTrim String method removes any leading and trailing whitespaces including tabs.
19. Extract Random Item From List
TheExtract Random Item From List method can used to get a random item from a list.
20. Extract Value From XML
TheExtract Value From XML method can used to get a value from an XML object.
21. Remove Pattern from String
TheRemove Pattern from String method can used to remove a substring from a string.
22. Get Array Length
TheGet Array Length method can used to get the number of items from an array.
Don’t forget, you can also use Endtest variables in all the Utilities methods.

