I am trying to use verifyText to verify en element that contains carriages return :
I tried to set Value such as “Text1\nText2\nText3” but it doesn’t work. How can I describe carriages return in the Value field ?
Thank you for your response.
First, may I suggest you use double slashes in your comparison.
and you may need to set your boolean isRegex reference to true as in:
Just a note that “\n” is a combo of carriage return and line feed (char(13) and char(10)). You can also try to use “\v” or “\R” or char(13) char(10).
You should use a Regular Expression with Character class
\s (a whitespace character:
[ \t\n\x0B\f\r]) and Quantifier
* (zero or more),
+ (one or more).
String expr = '\\s*Text1\\s+Text2\\s+Text3\\s*'
boolean result = WebUI.verifyTextPresent(
true, // 1st arg is Regular Expression