How to Pass the POST REST API, response to the next test step in ATF

Rohit Tamrakar
Kilo Explorer

I am currently creating a Test case ATF, as per the defined test steps available in ATF London how to I pass the output response to the Input for the Next test step. Example when I use a Post REST API , I get a response body (which contains result : CHGXXXXXX along with Code. I want to use the Change record number as Input to next step for PUT REST API. Please help.

When I m trying to use the previous step input I get the complete xml as input for next step.

3 REPLIES 3

Ct111
Tera Sage

I believe you need to do it via scripted web services.

 

Just refer the below

https://developer.servicenow.com/app.do/app.do#!/lp/servicenow_application_developer/app_store_learnv2_rest_london_parsing_a_rest_response?v=london

 

 

here it shows how the response that was received was fed to a variable in script.

 

In the same way the CHGXXXXXX you received can be fed to a variable 

 

Mark my ANSWER as CORRECT and HELPFUL if it gave you an idea.

The link refers to IntegrationHub whereas the question refers to ATF.  

Sagar Baver
Kilo Contributor

None of the automated REST test steps under ATF (versions <= Newyork) provide an output referencing the API response.
I believe your best option is to submit the record that you would typically create using REST APIs using ATF UI test steps and use the sys_id from the step output to make further assertions.