09-11-2020 04:24 AM
Hi - All my test steps use the .Net step types. Is there a way to pass back to (or read from) my C# code the current TestStand thread number that has called my C# code?
When my C# code creates its own log files, it would be helpful to append the TestStand thread number that has generated the C# log file entry to aid sorting and following test execution in a multi-threaded TS sequence.
The current C# log file works well in a single threaded TS sequence but as soon as you add more threads then obviously the C# log file entries are not in an easy to read execution order since they are generated by the multiple threads running.
Thanks in advance,
Chris
thanks in advance
09-16-2020 01:52 PM - edited 09-16-2020 01:52 PM
Hello Chris,
You have two methods of doing this:
1. Pass the Sequence Context Reference to your test steps. In your teststep you can use the reference to extract the Thread Reference and later the UniqueThreaID.
2. You can pass directly the ThreadID to your TestStep by passing the RunState.Thread.UniqueThreadId as input to your teststep.
Hope it helps,
Just a TSUser
09-18-2020 10:29 AM
Many thanks for your suggestion.
Regards
Chris
09-18-2020 01:28 PM
You are welcome!
If you have validated the solution, please don't forget to mark as solution to this forum thread so that it can be considered as closed !
Cheers,
Just a TSUser