08-20-2015 06:08 AM
Relatively new to TestStand, and struggling with a problem.
I want to "scan" a test sequence, and for every step in the sequence where the name starts with a 4 digit number (i.e. "0400 - Measure...") i would like to add an additional result with the name "StepNumber" and the value being the specific 4 digit number. I'm assuming that i should use calls to the TestStand API, but my experience with this is almost non-existing, so any advice on where to begin would be greatly appreciated.
08-20-2015 08:30 AM
Is this a tool that will run independently of TestStand? Or will it run every time the sequence file is executed? Or is it something you just need to do once?
If it's a one time thing then you can select all of the steps that have the 4 digit number and modify them all at once in the sequenc editor. With them all selected choose the Additional Results category on the Properties tab. Then put "StepNumber" in the Name column and put Left(Step.Name, 4) in the Value to Log column.
If you want to do it through the API then you would use:
Step.AdditionalResults.Insert("\"StepNumber\"", "Left(Step.Name, 4)", "True", PropFlags_IncludeInReport, 0)
Hope this helps,
08-21-2015 02:17 AM
Thank you for the reply.
It will not be necessary to have it run every time the sequence file is executed. What I am really trying to achieve is, that when i am done writing a test sequence i want to fill in the additional results as written in my original post, as easily as possible. I am just unsure how to do this. If there is a good way of doing this as an independent tool, that would be great.
I guess the option of selecting all of the steps and configuring them simultaneously would work, but usually our test sequences will consist of 10-15 subsequences, so i would have to do it for all of them.
08-21-2015 02:11 PM
I threw this together really quickly to demonstrate how to do this dynamically. It would be better if you made a Tool in the Tools menu and used RunState.InitialSelection (read about it in the help).
However, this example will work for ALL sequence files that are open, including itself. It only doe the Main_StepGroup of each sequence and it doesn't check to see if there was already an additional result that matched the first 4 characters. So if there already is one it will now have 2.
It's something to get you started though.
Let me know if you have questions.
08-26-2015 02:22 AM - edited 08-26-2015 02:24 AM
Thanks alot. I will take a look at it, and get back to you if i have any questions.
EDIT: We are only using TestStand 2012 in my company. Can you re-compile it to an older version?
08-26-2015 01:41 PM
2010
10-20-2015 02:40 PM
Jiggawax,
Can you save this sequence file in Test Stand 2013? I can't open it up.
Thanks!
10-20-2015 02:41 PM
Nevermind, I see your repost above. Thanks!