Forum Discussion

Intermountain_H_3's avatar
16 years ago

[SOLVED]DataSink using old file

I'm using soapUI Pro 3.5, downloaded & installed on 3/2/10
I have a script that sets the file name of a 'File' DataSink based on the name of a user selected  'File'  Data Source and a time stamp.
It then performs a number of steps, ultimately populating a Property Step which is followed by a Property Transfer Step and then the DataSink step.

I run this script multiple times and invariably the DataSink step writes the data to the File specified in the previous run. Additionally, the data does not get written to the file until the script terminates, rather than in real time (sounds similar to a problem you addressed in my post of December 4, 2009).

This even happens after closing soapUI & reopening it far the second run.'
  • Hello,

    This should now be fixed in the upcoming nightly build. One thing to note is that soapUI creates the file (if it does not exist) when the Test is started. This means that a file will be created for the DataSinks filename when you run the test. Once the filename changed, a new file will be created, but the old one (which should be empty) will still exist, so you may end up with two files after running the test.

    Regards,
    Dain
    eviware.com
  • The data is now written to the cortrect file, with the previous file being creted as you suggest.

    However, the data does not actually get written to the Datasink file until the entire test case terminates.  This was was corrected in 3.0.1 for my Dec. 4, 2009 post, by actually writing the data to the file at the end of the DataSink step, rather than waiting until the entire test case terminates.

    My test case has one last step, following completion of my Data Loop, of executing an external .exe to evalate the data generated in the test case.  This is failing because the data has not been written to the DataSink file yet.
  • Let me take that last post back.

    The write does appear to be happening with the DataSink step, as it should.

    Sorry for my mistake.
  • One more try (with the latest build from 3/2/10):
    simple test case with
      Datasource of a file with one column (5-6 rows)
      Property Transfer transfering that tem to the data sink step
      DataSink that writes that value to a file
      Dataloop based on Datasource looping to the Property Transfer
      Delay for 60 seconds

    I run the script, the output file is created, windows explorer shows file length of 0, until the Delay step (script) completes.

    How can I get the data to actually be written to the file with each DataSink step execution?
  • Downloaded & installed build dated 3/18/10
    executed the attached script against the attached data source
    Watched the dataSink file with windows explorer & with TextPad
    File gets initialized (if it already exists) but no data is written to it until the end of the wait step.
    I'm expecting it to be written with each pass of the DataSink step.
  • Hi!

    ok.. I've added a flush statement so that the contents of the file are written to disc for each iteration, can you give this a try (in the upcoming nightly build).

    regards!

    /Ole
    eviware.com