From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to repeat one test sequence step?

Hi there,

 

I've been testing the NI TestStand 4.1 evaluation system to see does it fit our company needs. It's almost what I expected to do except that I didn't manage to repeat only one failed step from the sequence and correct the report result. It can be done through the LabView or .NET interface by selecting witch step to repeat before the sequence have finished,  but I want to know if there is a integrated tool for this in TestStand.

 

Best regards,

Victor

0 Kudos
Message 1 of 13
(6,978 Views)

victor,

 

Welcome to TestStand!!  It's by far the best off the shelf test automation software out there. 

 

Are you talking about immediately repeating the failed steps?  Or are you talking about repeating the failed steps after the test has completed?  If you want to immediately repeat on a fail there are a couple options. If you look at the Properties for a step you'll see the Post Actions.  Basically this is anything that happens after the step has completed.  There is a On Fail box in there and you can change that to Goto step and choose the same step.  Or you can choose a sequence and create a sequence that will wait for the operator and then return and repeat the step.  There is also an Engine Callback which you can add and modify if a step fails as well.  You could do some manipulations in there.

 

Basically you'll find that in TestStand there are several (some better some worse) ways to accomplish what you want.  Most of it is possible (either through callbacks, properties or code modules). 

 

One good place to look is in the TestStand reference manual about step execution.  There's a table in there with an exact layout of what exactly happens when a step executes.  Understanding that can help you decide where you want to force the step to repeat. 

 

Hope that helps.  Let me know if you have any questions.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 13
(6,970 Views)

Hi again,

Thank you for the reply. I have another question. So I got the idea how to repeat failed step, but when I've repeated a failed step and it passes the conditions the report generation tool includes all previous failed results in the output report.

Example:

Voltage1 Test        Failed

Voltage1 Test        Passed

 

Is there any way to include only the last execution value of the step result in the report?

 

Victor

0 Kudos
Message 3 of 13
(6,954 Views)

Victor,

 

There are a couple of ways to accomplish this:

 

1. Using the step Properties looping options, set the looping to use Pass/Fail count and loop 2 times and stop after 1 iteration passes. Uncheck the Record result of Each Iteration.

 

2. Place your Voltage Test in a lower level sequence and call it from a Pass/Fail Test sequence. Use a statement to evaluate the test step statuses, returning the logical OR of the two tests as a Boolean parameter back to Step.Result.PassFail (along with any other parametric data you might want). Turn off the Record Result and SFCSF flags on your steps in the sequence, and you should see what you want in the report.

 

There are probably more ways, but these are the two that I would consider using.

 

Hope this helps.

 

-Jack

0 Kudos
Message 4 of 13
(6,946 Views)

Look at the Looping properties of the steps.

Select the Pass/Fail count options 

UN-CHECK Record Result of Each Iteration.

Set Stop after 1 iterations pass.

Set the maximum iterations to the total number of tries you wish.

 

So if stop after 1 iteration pass or after a maximum of 10 iterations is set

The step will loop until the first one passes and only report the pass for the last one.

If it never passes then the step will loop for 10 times failing them all and report fail only for the last one.

 

Omar 

Message 5 of 13
(6,945 Views)

Thank you both for the replays.

So, the problem here is a little bit different. I want to repeat the test step at the end of the sequence or by callback sequence. May be more appropriate solution will be to modify the report result at the end of the sequence. Is there any way to get a collection of the test report result before it is passed to the report engine?

 

Best Regards,

Victor

0 Kudos
Message 6 of 13
(6,926 Views)

Hey victor,

 

You actually can do that.  Here's a thread with it: http://forums.ni.com/ni/board/message?board.id=330&message.id=21363#M21363

 

However this will probably not be the best solution for you.  Only because the entire sequence fails and you would have to parse and parse until you were sick of parsing.  Each step gets stored in the Locals.ResultList for that sequence, which is then used to generate the report.  If you delete it out of there it won't get registered in the report.  So like after the step you could delete the element out of Locals.ResultList with the failed information.

 

Let me know if you need help accomplishing this as it can be tricky.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 7 of 13
(6,923 Views)
One more thing- You may have to also change the RunState.SequenceFailed to false as well.  This is the overall variable the report uses to tell whether a sequence passes or fails.
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 8 of 13
(6,921 Views)

Ha!  Forgot to mention the other obvious solution here. 

 

Configure>>Report Options  Change Result Filtering Expression to Passed/Done Only.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 9 of 13
(6,918 Views)

Hi everybody,

jigg, I need a perfect report output, so non of the above solutions is good to me. But thank you for the proposals. Here is my solution for now with little programming.

 

So, when the steps witch have to be repeated are returned from the operator, foreach loop is going only through the top hierarchy of the sequence Result List. So, the selection will be only from those steps. When the loop finds a selected step, procedure will delete the Result List item. If it's a subsequence it will delete also the Result List array. After this procedure, the step is executed.

 

I have one question about the variables. RunState.SequenceFile.Data.Seq["MainSequence"].Main["V1"].Result.Status will return the status of the last execution of the step right? And whit GOTO: RunState.SequenceFile.Data.Seq["MainSequence"].Main["V1"] can I execute the step?

 

Thanks, 

Victor

Message Edited by victor.t on 10-10-2008 03:06 AM
Message Edited by victor.t on 10-10-2008 03:08 AM
0 Kudos
Message 10 of 13
(6,889 Views)