Ask a Question

Input JSON output from a testcase to another testcase

SOLVED
sudhagowri
Occasional Contributor

Input JSON output from a testcase to another testcase

Hi there,

 

I have 2 test cases in my test suite where the first test case's output is the next test cases input. The first test case is where after running the test it should give a response in JSON as

 

{"clientId": 5}

 

I need to input '5' (-> this number always changes), into the next test case for it to be automatically run without me to input. I have a set of test cases which needs this number to be taken from the previous test case as seen in image B.

 

How do i go about parameterising JSON script to take in part of an output from another testcase?

 

Thanks for helping 🙂

Sudha

1 ACCEPTED SOLUTION

Accepted Solutions
sudhagowri
Occasional Contributor

Re: Input JSON output from a testcase to another testcase

Hi All,

 

Thank you all for the suggestions. I have found the way to include the previous test case output. This is by highlighting the query and the right click -> Get Data and choose the source test case's output. Shown in the attached screenshot.

This works for me.

 

Thanks,

Sudha

View solution in original post

4 REPLIES 4
soalri
Occasional Contributor

Re: Input JSON output from a testcase to another testcase

hello everybody, 

 

Unfortunately I have the same problem 😞 

 

Thanks for helping,

rim

PaulMS
Super Contributor

Re: Input JSON output from a testcase to another testcase

There are a few different ways to get the same result

https://community.smartbear.com/t5/SoapUI-Open-Source/How-pull-property-value-to-the-next-json-body-...

 

This property expansion is an example to get data from another test step response

${Get Client id#Response#$.clientId}

nmrao
Community Hero

Re: Input JSON output from a testcase to another testcase

Dependency between the test cases should be avoided.
If it is really needed and left out with no option, then save the value into test suite level custom property and use it in other test cases by having Property Expansion.


Regards,
Rao.
sudhagowri
Occasional Contributor

Re: Input JSON output from a testcase to another testcase

Hi All,

 

Thank you all for the suggestions. I have found the way to include the previous test case output. This is by highlighting the query and the right click -> Get Data and choose the source test case's output. Shown in the attached screenshot.

This works for me.

 

Thanks,

Sudha

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: