Forum Discussion

testhrishi's avatar
testhrishi
Frequent Contributor
7 years ago

DataSink overwriting the same line on Excel

I have Datasink process overwritting on the same row for my Excel document for the proces which I am getting to loop 5 times using conditional goto.

 In the logs I can see the all 3 steps inside my tests case are getting executed as expected, in which the last step is the datasink where I am writing the captured properties in a excel file.

Wonder what I need to do so that sink will write on new row each time the step gets executed?

5 Replies

  • lakshmiarun's avatar
    lakshmiarun
    SmartBear Alumni (Retired)

    Hi,

     

    Thank you for posting in our forum.

     

    Make sure you check a couple of things listed below:

     

    1. You have the Datasource loop

    2. Datasink teststep is above the Datasource loop.

     

    Please take a look at the screenshot below:

     

    https://www.screencast.com/t/AAivn27jZA

     

    Best,

    Lakshmi

     

     

     

     

     

    • testhrishi's avatar
      testhrishi
      Frequent Contributor

      I think DataSink should work without any datasource loop. I am reading anydata from anyhere, so why do I need a data source loop?

  • MikeGatward's avatar
    MikeGatward
    Occasional Contributor

    If you want to loop then datasource loop is the way to go

     

    Sounds like your method is treating these as single tests hence it will just overwrite. Datasource loop will ensure each row is written separately

     

    and make sure you're excel is not open when to run the tests otherwise nothing will be written

    • testhrishi's avatar
      testhrishi
      Frequent Contributor

      The way I read it, Datasource shall be use to read data and Datasink shall be use to write/dump data. If I just need to dump data, datasink shall work but looks like thats not the case for excel.

       Worked fine for notepad

      • lakshmiarun's avatar
        lakshmiarun
        SmartBear Alumni (Retired)

        Hi,

         

        That is how excel works. After looping through a value excel sheet shuts down and opens up only for the next loop. This is tool independent.

         

        Best,

        Lakshmi