Forum Discussion

smadji's avatar
smadji
Contributor
12 years ago

[Res] assertion fail but should pass

I must be doing something wrong but been at it for hours and can't figure out what I it is.

I am trying to assert between 2 requests and the item that I am asserting should and does return the same results

my error is:
XpathContains comparison failed for path [...], expecting [<str name="workPhone">123456</str>], actual was [123456]

I attempted to retrieve the assertion validation from the response and from the responseAsXml options.

2 Replies

  • Hi,

    It seems that you may be comparing one node above the <str> node with the actual <str> node value of 123456.
    Can you show what your XML looks like in the two cases?

    Regards,

    Giscard
    SmartBear Support
  • I have attempted to verify against the str and against the value and it did not work.
    However, I reversed between the test steps and run the second one first and use the second one for assertion and the assertion works there fine.