Trim
Last updated
Last updated
The Trim Action in the Avo Assure found under the @Generic Element helps remove the any extra spaces existing before or after the input text. This ensures that the input is neatly formatted without unnecessary spaces.
Input: <input string>
Output: <Dynamic Variable>;<Dynamic Variable>(Optional)
Scenario: Handling unrequired space in credentials field
When testing a login form, extra spaces before or after inputted credentials, like passwords, may cause login failures 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.