Forum Discussion
- SmartBear_SuppoSmartBear Alumni (Retired)Hello,
This sounds like a correct setup, what issues are you having?
Regards,
Dain
eviware.com - BhuvanShanmugamContributorWell
I want each thread to have its own data source if possible.
I also want each thread to write its output to a seperate output file.
I also want to log the time it took to process the test case into the output file (for each thread - for each soap call to server)
Thanks,
Bhuvan. - BhuvanShanmugamContributor
- SmartBear_SuppoSmartBear 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:
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 - BhuvanShanmugamContributorHi Dain,
I have managed to get multiple data sources and sinks with multiple threads.
however, Ive never done any groovy stuff - so is there a way to get the time into the data sink other than using groovy..
i already use property from the test case output to write into the sink.
using ${testRunner.timeTaken} as a property value doesnt work.
Bhuvan. - SmartBear_SuppoSmartBear Alumni (Retired)Hi!
you could try ${=testRunner.timeTaken} instead (which evaluates your statement as a groovy script)
Does that help?
regards!
/Ole
eviware.com
Related Content
- 2 years ago
- 4 years ago
- 6 years ago
Recent Discussions
- 42 minutes ago
- 16 days ago