Forum Discussion
orion1
13 years agoNew Contributor
Hi,
I'm using soapui 3.6.1 free version, and my json response is converted into a xml format with no problem.
My step is a REST request, and i have set "application/json' as accepted encoding for response.
For information, my JSON response starts like that: [{"first": { ...
Anyway, it should not blocked your tests, as you can use groovy to validate your json response. My script looks like:
import com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep;
import net.sf.json.groovy.*;
RestTestRequestStep step = testRunner.testCase.getTestStepByName( "MyStep" );
String response = step.getProperty( "response" ).value;
def slurper = new JsonSlurper();
def result = slurper.parseText(response);
def level2List = result.level1.level2;
...
Hope this would help,
Regards
I'm using soapui 3.6.1 free version, and my json response is converted into a xml format with no problem.
My step is a REST request, and i have set "application/json' as accepted encoding for response.
For information, my JSON response starts like that: [{"first": { ...
Anyway, it should not blocked your tests, as you can use groovy to validate your json response. My script looks like:
import com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep;
import net.sf.json.groovy.*;
RestTestRequestStep step = testRunner.testCase.getTestStepByName( "MyStep" );
String response = step.getProperty( "response" ).value;
def slurper = new JsonSlurper();
def result = slurper.parseText(response);
def level2List = result.level1.level2;
...
Hope this would help,
Regards
Related Content
Recent Discussions
- 2 days agoemoya
- 2 days agoMyBalanceNow