Forum Discussion

nmrao's avatar
nmrao
Community Hero
9 years ago

Re: Cannot Change Output File Within a Loop

A screen shot showing the problem and your script will help to get the faster resolution.

2 Replies

  • canpan14's avatar
    canpan14
    Occasional Contributor

    I'm not sure how to properly screenshot it but I will try.

     

    Here is the first screenshot with the test flow. It is pretty simple.

     

    In the below screenshot. It runs over several files (On the left). But always just outputs to a single file on the right (All of the data is correct in the file, but it needs to be split up into multiple).

     

    The code to change the output path is pretty simple and I've already tested it works correctly.

    def filename = context.expand( '${Read in File Names#Filename}' )
    def outPath = "PATH/" + filename + ".xlsx"
    testRunner.testCase.testSteps['Properties'].setPropertyValue("OutputPath",outPath)

    Also here is the datasink step.

     

     Thanks

    • canpan14's avatar
      canpan14
      Occasional Contributor

      Quick update. I tried slimming down the test to just loop and make multiple output files (Changing the output name), ignoring any data changes.

       

      Still ran into the same issue. So maybe this just isn't possible. At least with excel files.

       

      Might stem from the fact that soapui doesn't like release files from memory sometimes.