Using Regular Expression (Regex)
The Testim Editor supports Regex inside the Expected Value input. Let's cover the most common cases:
Starts with: Validates that the text starts with a certain word, allowing the rest of the text to be dynamic, and still pass the validation:
Ends with: Validates that the text ends with a certain word, allowing the rest of the text to be dynamic, and still pass the validation:
Contains: Validates that the text contains a certain word, allowing the rest of the text to be dynamic, and still pass the validation:
Of course you can create and use any other valid Regex that you may need.
Tip RegexOne is a great place to learn and practice regular expressions.
new Date().toDateString(), and The Testim Editor will compare the calculated string result of this expression. See a failed validation:
Using a parameter
For example I have exported from a prior step the user name to the parameter
Now I want to validate that we greet the user accordingly - so we'll add a text validation on the greeting label:
'Hello ' + userName + '!'