Forum Discussion

VLiljeb_ck's avatar
VLiljeb_ck
Occasional Contributor
12 years ago

Ignore returns in assertion

Hi,

I am using xpath match to validate the response of a SOAP response, the response is compared against a JDBC response. The problem is that the JDBC response includes a return in the middle of the response. Is there someway this can be ignored in the xpath expression?

XPathContains comparison failed,
expecting [Number of opened dep accounts: 1 (Code 10). Number of cancelled dep accounts: 1 (Code 12).],

actual was [Number of opened dep accounts: 1 (Code 10).
Number of cancelled dep accounts: 1 (Code 12).]

2 Replies

  • VLiljeb_ck's avatar
    VLiljeb_ck
    Occasional Contributor
    I solved it myself, finally

    Here is the answer if somone else bumps in to the same issue..
    Add normalize-space in front of both the SOAP response and JDBC response.
  • He he, I just posted a solution based on Groovy, but this is obviously much better. Interesting! I didn't know about this XPath function.

    Thanks for sharing!

    Kind regards,
    Manne Fagerlind
    SmartBear Sweden