Forum Discussion
SmartBear_Suppo
16 years agoSmartBear Alumni (Retired)
Hello,
You can differentiate between threads during a LoadTest by using the thread index (context.ThreadIndex). Using this you can have separate DataSources and DataSinks, for example, you could have a File DataSource and use the filename "data_${ThreadIndex}.txt" (and then have separate data files for each thread, data_0.txt, data_1.txt, etc).
You can do the same for the output. In the TestCase Setup script put something along the lines of:
And then use context.logger for any output that needs to be saved to file.
To get the time for the TestCase, you can put this in your TestCase TearDown Script:
Regards,
Dain
eviware.com
You can differentiate between threads during a LoadTest by using the thread index (context.ThreadIndex). Using this you can have separate DataSources and DataSinks, for example, you could have a File DataSource and use the filename "data_${ThreadIndex}.txt" (and then have separate data files for each thread, data_0.txt, data_1.txt, etc).
You can do the same for the output. In the TestCase Setup script put something along the lines of:
context.logger = new FileWriter("out_"+context.ThreadIndex+".txt", true)
And then use context.logger for any output that needs to be saved to file.
To get the time for the TestCase, you can put this in your TestCase TearDown Script:
context.logger.println "Time taken: " + testRunner.timeTaken
context.logger.close()
Regards,
Dain
eviware.com
Related Content
- 2 years ago
- 4 years ago
- 6 years ago
Recent Discussions
- 7 hours ago
- 17 days ago