Forum Discussion
5 Replies
- Hello,
Try adding a Script Asserting containing the following code:
if(messageExchange.responseContent.contains("\r\n")) {
assert true
} else {
assert false
}
Regards,
Dain
eviware.com - mngContributorthanks for your information.
is there any way to check under xml response?
also, how to do if i have to check whether a new line present before a bullet "•"? - mngContributor
mng wrote: thanks for your information.
is there any way to check under xml response?
also, how to do if i have to check whether a new line present before a bullet "•"?
any idea for the problem?
Let say the response is
"Please bring the following items,
• Computer"
How to make assertion of the new line and tab appear before the bullet? - Hello,
Well, for an XML response you could match the content of a specific element against a regular expression perhaps?
In the Outline view showing the response, right-click the desired element, and select "Add Assertion..." "for Content matching RegEx". When prompted to specify a regular expression to match against, you can use ".*\n.*" (without the quotes) to match some text containing a newline character. The expected result should be "true". The generated expression should be simmilar to this:
declare namespace sam='http://www.soapui.org/sample/';
matches( //sam:loginResponse[1]/sessionid[1]/text(), '.*\n.*' )
Regards,
Dain
eviware.com - mngContributorok.
thanks for your help