The Testim Editor supports Regex inside the Expected Value input. Let's cover the most common cases:
Validates that the text starts with a certain word, allowing the rest of the text to be dynamic, and still pass the validation:
Validates that the text ends with a certain word, allowing the rest of the text to be dynamic, and still pass the validation:
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.
- RegexOne is a great place to learn and practice regular expressions.
- RegularExpressions 101 is a great tool for developing and testing a regular expression.
new Date().toDateString(), and The Testim Editor will compare the calculated string result of this expression. See a failed validation:
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 + '!'