Need to use Regular Expressions in our UFT API Tests
♥ 0 |
I need to use some regular expressions in my API tests. I’m using UFT 15.0.2. I can’t seem to figure out how to do it, and the help documentation doesn’t really have much info on it. It seems to indicate at this page that you can use REGEX in API tests, but it doesn’t really explain how. How do you implement using REGEX in API tests??
Marked as spam
|
Private answer
I was researching this too and found that Micro Focus recently published a KM article about this. The article says that "Regex requires declaration at the top of the script:"
And gives the following examples:
[Serializable()] Then they give some sample code:
sText = "abcd"; this.Context.UserLogger.Info(" String: '" + sText + "'"); //- Pattern found //- Pattern NOT found which gives the following output:
Marked as spam
|