Forum Discussion

itaykaldi's avatar
itaykaldi
Contributor
11 years ago

[Res]write files with multi thread

Hey,
I run 5 threads, each thread write to file, with 'File' class by groovy script.
But only one file was created,
How can I write to files with multi thread (each tread to new file)

10x.

3 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    The file will be created 5 times by 5 threads in load testing but it will be replaced. If you want the file to be created 5 times you need to change the groovy script so that every time the file is created it will have a different name.

    Thanks,
    Jeshtha
  • It's what I did...
    Every file name is unique by threadIndex...
    But only one file created, seems like one thread block other threads to create new files...
  • I found my problem,
    I delete the directory with Setup Script in Test Case instead of in Load Test... So it deletes the directory every thread...