Ask a Question

[SOLVED]ThreadIndex in DataSink file name

M_McDonald
Super Contributor

[SOLVED]ThreadIndex in DataSink file name

I am running a load test with a test case that has a DataSink that writes to an Excel file. I want to use the ThreadIndex to create unique filenames, but I keep getting 0 for all threads.

Here is the Out File value:

${projectDir}/results/${#TestCase#datasinkFile} - ${=String.format('%tY%<tm%<td-%<tH%<tM%<tS', new GregorianCalendar())} - ${ThreadIndex}.xls


and a resulting filename:

Test Results - 20091014-144643 - 0.xls


What am I doing wrong?

I am using build 3.0-pro-daily-build-2009-09-28-[1]

Thanks.
"Ignorance more frequently begets confidence than does knowledge"
9 REPLIES 9
SmartBear_Suppo
SmartBear Alumni (Retired)

Which load test strategy are you using?

/Nenad
http://eviware.com

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
M_McDonald
Super Contributor

Simple.
"Ignorance more frequently begets confidence than does knowledge"
SmartBear_Suppo
SmartBear Alumni (Retired)

Hmmm... I still cannot reproduce it on my side. Can you please check if the DataSink is shared? (It should not be)

/Nenad
http://eviware.com

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
M_McDonald
Super Contributor

It is not (in fact I tried it both ways.)
"Ignorance more frequently begets confidence than does knowledge"
M_McDonald
Super Contributor

I have isolated the problem. The test case I am running uses the Run TestCase step to run another test case which contains the DataSink step.

I have created and attached a simple project to demonstrate this. Running the load test in TestCase 2 will create files in the project directory with a ThreadIndex of 0 in all filenames.
"Ignorance more frequently begets confidence than does knowledge"
M_McDonald
Super Contributor

It would be nice if this worked as-is, but I have a workaround now. I created a parameter "threadIndex" in the called test case and I pass in ${ThreadIndex} in the Run TestCase step; then I use ${#TestCase#threadIndex} in the Out File field.
"Ignorance more frequently begets confidence than does knowledge"
SmartBear_Suppo
SmartBear Alumni (Retired)

Hi!

Thanks for your detective work! The upcoming nightly build propagates the ThreadIndex and any other context variables to the called TestCase, hopefully that fixes this issue.

regards!

/Ole
eviware.com

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
SmartBear_Suppo
SmartBear Alumni (Retired)

Hi!

Actually, there is now a new option in the RunTestCase options dialog that allows you to promote LoadTest related properties to the target testcase, try selecting that when running your loadtest.

let us know!

regards,

/Ole
eviware.com

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
M_McDonald
Super Contributor

Looks good so far.

Thanks!
"Ignorance more frequently begets confidence than does knowledge"
cancel
Showing results for 
Search instead for 
Did you mean: