02-26-2015 10:30 AM
Hi guys,
I want to get the Type of the Step by activex. I have the name but in case of a Statement Step the name can be changed.
If I get the Field Type that we can found on the tab Properties, General I will be able to get information I want following the Step Type.
Thanks in advance.
02-26-2015 11:40 AM
You can use Step.StepType.Name to get the type of step.
Hope this helps,
02-27-2015 02:10 AM
No, I don't want to use the Name. In case for example of a statement Step the name can be changed.
I'm creating a sequence that generate a documentation from a sequence file. Following the type of the Step I will get more or less information from it.
02-27-2015 04:47 AM - edited 02-27-2015 04:48 AM
The solution given is correct and working.
Its the name of the "step type" not step.
For a statement step type it will always return "statement" irrespective of the name of the added step.
02-27-2015 08:47 AM
Oh pfhenry21. I am hurt that you wouldn't trust my solution... however, I completely understand. Alas, I'm not always right. But in this case I am. 🙂
Did you give it a go?
Most objects in TestStand inherit from the PropertyObject class. The PropertyObject class has a property called Name. In my statement I return the StepType object by using Step.StepType. Then I use the Name property to get the name of that object. NOTthe name of the Step. If I used Step.Name then you would be correct in assuming that the name will change and can be anything.
And ultimately you will most likely be using something like: RunState.Sequence.Main[Some Index or Step Name].StepType.Name. Or if you are in an engine callback you would use something like: Parameters.Step.StepType.Name. Or if you are iterating through the sequence in an external code module it would depend on how you are getting the steps.
Hope this helps you understand it a little better.
Regards,