Forum Discussion
- nmraoChampion Level 3What values you need out of it?
- TanyaYatskovskaSmartBear Alumni (Retired)
Hi Piyu_sarda,
If you provided us with a sample project where this issue is reproduced, I would pass it to our Dev Team so that they could investigate this.
- piyu_sardaOccasional Contributor
Hi Tanya,
Finally after a good number of hours, I came to know the root cause of this issue. The response JSON contains a empty line at the top which SOAP UI is not able to process. Although the JSON view of Response in the Test Step shows a valid JSON but when performing a property transfer, it looks like it is picking up from raw response which has an empty line at the top. My dev team is not going to definitely fix this in a shorter term as the our APIs are used by other applications and no one complained about it.
Is there a way in SOAP UI to get around it? I have replicated this issue with a sample project. Do you still need it or the details are sufficient to replicate this?
Thanks,
Piyu
- piyu_sardaOccasional Contributor
Hi ,
I should be able to extract any value. For now you can look into href element under collection.
Thanks
- nmraoChampion Level 3
Have you looked into the sample provided
- nmraoChampion Level 3
May be you can use script assertion to see if that works as posted in
You may need, additionall statement, to set the test case property in order to be able to use the retrieved value from the response to other steps
If you look at the above thread value retrieved is in expectedValue variable.
The same value is need another (from your description as you are doing property transfer), add below line of code at the end:
context.testCase.setPropertyValue('PROPERTY_NAME', expectedValue)
and use property expansion in the later steps as ${#TestCase#PROPERTY_NAME}
- migueleisNew Contributor
I have same problem getting properties from JSON with SoapUI 5.2.0. This is my response object
{
"code": 0,
"message": "OK",
"sessionId": "3122d0bd-9f21-400a-b95d-87217adeab02"
}When try to get one of them from property tranfer (Property: ResponseAsXml; Path language: JSONPath) I have error:
Mon Sep 21 13:42:34 CEST 2015 sessionID [Invalid JSON: <Response xmlns="http://localhost/...">
<code>0</code>
<message>OK</message>
<sessionId>3122d0bd-9f21-400a-b95d-87217adeab02</sessionId>
</Response>]- nmraoChampion Level 3You can see the response as JSON. So, you may use the sample provided to extract the value using script assertion.
- migueleisNew Contributor
- nmraoChampion Level 3Glad to know.
Related Content
- 5 years ago
- 6 years ago
- 2 years ago
Recent Discussions
- 2 days ago