Forum Discussion

sudhagowri's avatar
sudhagowri
Occasional Contributor
8 years ago

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

  • 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

  • nmrao's avatar
    nmrao
    Champion Level 3
    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.
  • soalri's avatar
    soalri
    Occasional Contributor

    hello everybody, 

     

    Unfortunately I have the same problem :( 

     

    Thanks for helping,

    rim

  • sudhagowri's avatar
    sudhagowri
    Occasional Contributor

    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