Forum Discussion

zokirsalomov's avatar
zokirsalomov
Occasional Contributor
2 years ago

save value from response into external file

Hi,

 

Using readyApi, implemented data driven testing with steps of Data source -> GraphQL Request -> Data source loop.  GraphQL Request step returns json response and it contains number of json objects. for example:

{
"data" : {
    "info" : {
       "edges" : [
       {
             "node" : {
                "info" : [
                       {
                           "Name" : "AG",
                            "Devices" : [
                                          {
                                               "AccountId" : "123",
                                               "dev" : "123",
                                               "Model" : "123"
                                          },
                                         {
                                                "AccountId" : "123",
                                               "dev" : "123",
                                               "Model" : "123"
                                          },
                                        {
                                               "AccountId" : "123",
                                               "dev" : "123",
                                               "Model" : "123"
                                        },
                  ] 
           }
      ]
}


I need to get number of devices (3 in this example) and store in external file or same file in Data Source step. Is it possible? 

1 Reply

  • ChrisAdams's avatar
    ChrisAdams
    Champion Level 3

    Hi,

     

    Yes, you can save values from your data driven test to a text file.  Have a look at the datasink step.  You can write to various files types.