cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP UI 5.2 is throwing JSON invalid error while property transfer although JSON is valid

SOLVED
Highlighted
Occasional Contributor

SOAP UI 5.2 is throwing JSON invalid error while property transfer although JSON is valid

Hi,

I am getting proper collection JSON response as part of Rest API call. I have validated it using jsonlint.com. But when i am performing a property transfer from Response to next request, SOAP UI 5.2 gives me invalid JSON.

 

Could anyone please help? I have attached only the structure of my JSON response and have removed the values.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Contributor

Re: SOAP UI 5.2 is throwing JSON invalid error while property transfer although JSON is valid

Finally I succeeded with this configuration.

 

Thanks.

View solution in original post

16 REPLIES 16
Highlighted
Community Hero

Re: SOAP UI 5.2 is throwing JSON invalid error while property transfer although JSON is valid

What values you need out of it?


Regards,
Rao.
Highlighted
Community Manager

Re: SOAP UI 5.2 is throwing JSON invalid error while property transfer although JSON is valid

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.

 

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Community Hero

Re: SOAP UI 5.2 is throwing JSON invalid error while property transfer although JSON is valid

May be you can use script assertion to see if that works as posted in

http://community.smartbear.com/t5/SoapUI-Open-Source/View-Assertion-Value-in-SoapUI/m-p/105064#U1050...

 

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}



Regards,
Rao.
Highlighted
Occasional Contributor

Re: SOAP UI 5.2 is throwing JSON invalid error while property transfer although JSON is valid

Hi ,

 

I should be able to extract any value. For now you can look into href element under collection.

 

Thanks

Highlighted
Community Hero

Re: SOAP UI 5.2 is throwing JSON invalid error while property transfer although JSON is valid

Have you looked into the sample provided



Regards,
Rao.
Highlighted
New Contributor

Re: SOAP UI 5.2 is throwing JSON invalid error while property transfer although JSON is valid

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>]

Highlighted
Community Hero

Re: SOAP UI 5.2 is throwing JSON invalid error while property transfer although JSON is valid

You can see the response as JSON. So, you may use the sample provided to extract the value using script assertion.


Regards,
Rao.
Highlighted
New Contributor

Re: SOAP UI 5.2 is throwing JSON invalid error while property transfer although JSON is valid

Finally I succeeded with this configuration.

 

Thanks.

View solution in original post

Highlighted
Community Hero

Re: SOAP UI 5.2 is throwing JSON invalid error while property transfer although JSON is valid

Glad to know.


Regards,
Rao.
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors