04-20-2022 09:35 AM
Hi,
We are several people creating test sequences in TestStand and we use the same code modules, we have a problem where we name these step differently but use the same code module. Meaning that in one test sequence the testname could be RTC-Test and in another test sequence the name could be RTC Test, but the code base used during test is the same.
We would like to have the same step-name for the same code module (the name which the code module have), is there any way to control the step name in teststand to match the code module name automatically?
If not what is the best practice for this type of problem.
Thanks for your input!
Solved! Go to Solution.
04-21-2022 08:58 AM - edited 04-21-2022 09:06 AM
Executing a helper sequence file:
use the API to scan through the desired sequence files looking for LabVIEW Actions or Tests.
Once you find a Step, extract the code module name and changed the StepName accordingly.
Semi-Automatic:
Implement a sequence analyzer test which scans the desired sequences and identify those, where VI name does not correspond the step name. Change them manually.
Both approaches require the programmer to do something after coding
Just be aware that your desired policy will impose limitations on readablity of the sequence/ will affect reusablity of your code modules...
If you need to run the same VI multiple times, your test report will show the same test name multiple times as well
04-21-2022 09:13 AM
I tinkered a bit with the StepName:
the Sequence Editor interprets Step Properties -> General -> Name as a string, so there is no use putting an expression in there.
What works, is for example to have the Step Pre-Expression set to something like
Step.Name = Step.Module.ViCall.VIPath
So the step name would be changed during run time, but again additional actions are needed to save those modifications.
04-28-2022 01:07 AM
Thank you for your input, this is actually C# code modules and have tried using different approaches with a post expression statement, the closes thing i was able to get was the Class name by setting:
Step.Name = Step.Module.ClassName
But would like to get the method name.
Maybe there is another extension to use to get the method name?
Thank you for you answers this put me in the right direction! 😊
04-28-2022 09:28 AM
Hi Isabell
please take a look a this old thread.
https://forums.ni.com/t5/NI-TestStand/how-to-crate-an-action-step-in-teststan-using-C-along-with/td-...
on last page there an example that creates a .net step.
Hope that helps
Juergen
04-29-2022 04:46 AM
Hi
just realized that example not working in TS2020.
DotNetModule.LoadPrototypeFromMetadataToken is obsolete!
Now updated to DotNetCall.LoadPrototypeFromSignature
For your task step name to 1.Membername in post expression
Step.Name = Step.Module.AsDotNetModule.Calls.Item(1).MemberName
will do the trick
Hope that helps
Juergen
04-29-2022 04:57 AM
Thank you for your answer, this was very helpful and did the trick as you say 😀
Have a nice day!
Best Regards,
Isabel