Trim
Last updated
Last updated
The Trim Action in the Avo Assure is found under the @Generic Element is used to remove the extra spaces at the beginning or ending of the input this ensures that the input is neatly formatted without unnecessary spaces.
Input: <input string>
Output: <Dynamic Variable>;<Dynamic Variable>(Optional)
When a user is testing a login form and enters credentials, such as password, sometimes extra spaces are accidentally added by the user (either before or after the actual text). These spaces can cause the login attempt to fail, even if the credentials are correct.
Input: During automation testing, the test script is executed when the user inputs data as:
“ Password@123 ” (with leading and trailing spaces).
In this scenario, the trim action is used to automatically remove these unwanted spaces before submitting the credentials. This ensures that only the actual text is used, preventing unnecessary login errors caused by accidental spaces.
Expected Result: Input string needs to be stored in output variable without space.
Output: The result of Trim string is stored in the {result} output variable as “Password@123” (without space), which can be utilized for display or other purposes.