Javelin: saving a JSON response into a file

book

Article ID: 242029

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

How to store a JSON response captured in JObject from a RESTPutActivity step in a file.

Environment

Release : 4.9.1

Component : Javelin

Resolution

The RESTPutActivity step saves the JSON result in a JObject.
This can be converted to a string with the SerializeObject method.
It might also be possible to use the jobject.tostring() method.

A string can then be saved in a file with a FileActivity step

For a list of available methods for JObject see: 
https://www.newtonsoft.com/json/help/html/t_newtonsoft_json_linq_jobject.htm
https://www.newtonsoft.com/json/help/html/Overload_Newtonsoft_Json_JsonConvert_SerializeObject.htm