Forum Discussion

ptrindade's avatar
ptrindade
Occasional Contributor
4 months ago

Datasink - keep values

Hello all!

A simple issue I have that am not able to see a work around.

I have my tests to run in a cycle, and some results are being sent to a Datasink step.

Every time the cycle is stopped due to a failed step and then rerun from that failed step, all previous information that was already stored n the Datasink is erased, so I loose all data if a test step fails and reruns. 

Is there a way to keep that information stored even if a test cycle stops in the middle of a run and starts again that same cycle ?

 

Thank you so much in advance!

3 Replies

  • ChrisAdams's avatar
    ChrisAdams
    Champion Level 3

    Hi,

    You have a couple of options.  In the datasink step, you could check 'append to exisiting file'.  This will work, but your datasink file will grow and grow.

    Or, in the DataSink file name field, you can call a groovy script step which returns a file name with a timestamp.

    That way you get a unique file for each run.

    • ptrindade's avatar
      ptrindade
      Occasional Contributor

      Thank you for your help Chris,

      I forgot to tell that my Datasink type is Subreport, so I suppose "append to file" wont apply...

      any solution you may remember for the subreport ?

       

      Thank you!

       

       

       

      • ChrisAdams's avatar
        ChrisAdams
        Champion Level 3

        Im have never used sub-report, though after a having a quick look, I just might.

        Moving on from Append To File, I suppose you could still define a dytnamic and unique filename for the data sink.