mcaramto
5 months agoOccasional Contributor
Regex Checkpoint Javascript HELP!
Hello,
Can anyone help me how to use regular expression for checkpoints, I've been trying to use it, but my checkpoint keeps failing. I think I am doing it wrong.
I am trying to check if the property of an object returns an integer.
My code is something like this:
aqObject.CheckProperty(Object.Test, "Value", cmpMatches , RegExp("\d+"))
Result:
Thanks.
I think regular expression applies for string only. From https://support.smartbear.com/testcomplete/docs/reference/misc/regular-expressions.html "Patterns that property checkpoints use to verify string values."
Perhaps you can do it outside of CheckProperty by reading the integer value, convert it to string, store it in a variable, and perform your regular expression comparison.