Forum Discussion

lhuffstetler's avatar
lhuffstetler
Occasional Contributor
9 years ago

Datasource Loop randomizing data and using datasink to export to excel

Hello

 

 

I currently have a DataSink set up that is exporting my Rest step to excel but not exactly as I am wanting it to.  We do each POST using random data, we need to create a row in the excel file for that data that we used... so we can go back later and look it up.  I have a DataSource Loop set up for each Rest step because I need it to loop back and pull a new number after each step. Unfortunately, my DataSink seems to be exporting the information from the first pass and nothing else.  

 

Is there a way I can get the DataSink to look at each Datasource loop differently?

 

IE 

 

ID# and phone # 

Loop

ID# and Fax #

Loop

ID# email

Loop

 

instead of 

ID#, phone #, Fax #, email

 

I also need this to run onto multiple times and the entire TestCase to repeat onto a new sheet each time it starts over. 

 

Thanks in advance for any help you may provide. 

 

  • SmartBearAmber's avatar
    SmartBearAmber
    SmartBear Alumni (Retired)

    Check the order of your test steps. SoapUI test steps are executed sequentially from top to bottom. With a DataSink step combined with a loop, you'll want the loop to execute after the DataSink, otherwise only the last value will be written out.

     

    In order to get each value written separately, you'll need to add properties in your DataSink for each one.

    • lhuffstetler's avatar
      lhuffstetler
      Occasional Contributor

      Thank you for your quick reply!!

       

      Currently this is a snippit of what i have.  

       

       

       

      I have the main datasource at the top but the DataSink above the first loop.

       

      Thanks!

      • SmartBearAmber's avatar
        SmartBearAmber
        SmartBear Alumni (Retired)

        I would suggest looking at your configuration in the Test Step Overview tab and rearranging the order of your sinks/loops to acheive the desired result.