Forum Discussion

Prudential_UK_A's avatar
Prudential_UK_A
Frequent Contributor
15 years ago

XPath match assertion failing

Hi,

I've got an xpath match assertion in my project that is checking that 1 result is greater than another.  You can see in the response that the assertion should pass as the figures returned are correct, however the assertion is failing.  This assertion is cloned on many other test cases and is working fine, but in this particutlar instance, we cannot get it to work. I will email the project file with a mock service so that you can look into it in more detail.
Thank you

Nicole

2 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    I've taken a look at your XPath, and it seems that you are comparing the values as Strings. Because of this the values are compared alphabetically. You need to convert the values to numerical values before comparing them, so change the XPath to:

    number(//ns1:...) > number(//ns1:...)

    Regards,
    Dain
    eviware.com
  • Prudential_UK_A's avatar
    Prudential_UK_A
    Frequent Contributor
    Hi
    I tried this with the latest nightly build (Build 3.0-pro-daily-build-2009-11-17-[1], Build Date 2009/11/17 05:19) and it still fails.
    Have you had time to look at this? It is quite a major bug imho
    Regards
    Peter