kralston
12 years agoOccasional Contributor
Transfer from XML Response
I am attempting to transfer the Id value in an xml response to a suite property using a Property Transfer step.
The response looks like the following:
<Response xmlns="http://cltp10-serviceqa05.arbfile.org/afapi/rest/documents">
<error/>
<documents>
<e>
<Date null="true"/>
<barcode>H000000000365201</barcode>
<cover null="true"/>
<Base null="true"/>
<Relative null="true"/>
<Id>365201</Id>
<Status>NOTRCVD</Status>
<Size null="true"/>
</e>
</documents>
<return>200</status>
</Response>
Transfer Step config
1. Source set to the Rest Request step and it's property to Response
2. Entered - /Response/documents/e/Id
3. Target set to the Test Suite and property set to DocId
Executing this transfer generates the following error - Unexpected element: CData.
I have also set the source property to ResponseAsXml
but this gives an error also - Missing match for Source XPath...
I have also attempted to declare a namespace and altered the /Response/documents/e/Id in a variety of ways but without success.
I have cut and pasted the Response XML into the Altova XMLSpy tool entered the same XPath - /Response/documents/e/Id
and the value 365201 is properly returned.
More puzzling is that this test suite ran several months ago without error. This is a fresh checkout from our subversion repository and has not been edited in sometime.
Any help on this would be greatly appreciated.
The response looks like the following:
<Response xmlns="http://cltp10-serviceqa05.arbfile.org/afapi/rest/documents">
<error/>
<documents>
<e>
<Date null="true"/>
<barcode>H000000000365201</barcode>
<cover null="true"/>
<Base null="true"/>
<Relative null="true"/>
<Id>365201</Id>
<Status>NOTRCVD</Status>
<Size null="true"/>
</e>
</documents>
<return>200</status>
</Response>
Transfer Step config
1. Source set to the Rest Request step and it's property to Response
2. Entered - /Response/documents/e/Id
3. Target set to the Test Suite and property set to DocId
Executing this transfer generates the following error - Unexpected element: CData.
I have also set the source property to ResponseAsXml
but this gives an error also - Missing match for Source XPath...
I have also attempted to declare a namespace and altered the /Response/documents/e/Id in a variety of ways but without success.
I have cut and pasted the Response XML into the Altova XMLSpy tool entered the same XPath - /Response/documents/e/Id
and the value 365201 is properly returned.
More puzzling is that this test suite ran several months ago without error. This is a fresh checkout from our subversion repository and has not been edited in sometime.
Any help on this would be greatly appreciated.