Forum Discussion

TwoFang's avatar
TwoFang
Contributor
8 years ago
Solved

What have happened with JSONPath Expression and the usage of responseAsXML in readyAPI 1.8 (or 1.7)

Hi,

Been using readyAPI 1.6.0 for a while and many of the assertions i have looks like the following:

$[?(@.shortName=='${#[NameOfTestCase]#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/SHORTNAME_[1]}')].type[0]


And this work flawless. I now upgraded to readyAPI 1.8.0 and now they no longer work, they all result in
"...Expected value: [testValue]; Actual value: []...."

If i instead use XPATH expression to validate in the same way like this:

//Response[1]/e[shortName='${#[NameOfTestCase]#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/SHORTNAME_[1]}']/type[1]

This works with no problem so I don't see that there is a problem with extracting the correct value using the ResponseAsXml which makes me to assume that it's JSONPath Expression that is broken in readyAPI 1.8.0

Can anyone tell me what i'm doing wrong or what have changed. Don't really want to update 100++ test assertions from JSON to XPATH

Regards
/N

4 Replies

  • This bug have now been fixed in the readyAPI 1.9 maintenance release

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

     

    Hi TwoFang,

     

    From my understanding, the code that used to work fine in v. 1.6 should work in the new version without any issues. I recommend that you contact our Customer Care Team so that they could investigate this.

     

    Please share the solution with us once you find it.

    Thanks in advance.

     

     

    • TwoFang's avatar
      TwoFang
      Contributor

      After creating a support ticket it's have been confirmed that this is indeed a bug and it's been added to the backlog