How to Pass the POST REST API, response to the next test step in ATF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2019 08:18 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-18-2019 11:41 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2019 11:55 PM
The link refers to IntegrationHub whereas the question refers to ATF.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2020 01:25 AM
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.