Split
Last updated
Last updated
The Split Action in the Avo Assure is found under the @Generic Element. This Action in Avo Assure tells the client to break down a given string into smaller parts using a specific character, then it saves the result in an output variable.
Input: <string>;<split character>
1. String: It is actual string which will get split for further use.
2. Split Character: It use to break a string into smaller parts using a specific character (like a comma), making it easier to work with or check each part separately during a test.
Output: <Dynamic Variable>
Note: The result of Split action will be store in the {Variable} as an array, its starting from 0th index as shown below.
{Variable[0]},{Variable[1]}
{Variable[0]}: It will consider 1st string from input value as 0th index of array (e.g., John).
{Variable[1]}: It will consider 2nd string from input value as 1st index of array (e.g., Smith).
When a user is testing a form where users enter their full name, such as “John Smith,” the name can be split into two parts: “John” as the first name and “Smith” as the last name. So, here this action is useful for separating full names into individual components.
Input: In input values user supposed to give the string as followed:
John & Smith;& (In the place of “&” it separated by Comma (,))
Expected Result: Input strings should be separated by comma (,).
Output: These variable index values are saved in an {result} variable as:
First variable index value: “John”
Second variable index value: “Smith”
It will display as “John, Smith”.