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: 

Testcase become result dependent of pressing a button in a message box

Hallo,

 

I want a Testcase to become Failed / or Passed depemdemt of pressing a button in a message box. The message box is in the end of the sequence. There are 2 buttons - "Passes" and "Failed". How can I make the hole sequence failed by pressing the failed button?

0 Kudos
Message 1 of 3
(3,313 Views)

You can use the Post Expression to set the step to pass or fail in regard to the pressed button. This is how i would do it if i'd use the TestStand Message Popup step. If you are designing your own dialog, i would insert this into a pass/faill test. In regard of the button pressed, you dialogmodule would return true or false (for pass vs. fail) to TestStand.

If you set the option "Step Failure causes Sequence Failure" (is already set by default for most steps), this will pass/fail the whole sequence....

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 3
(3,306 Views)

Hi,

  there's two ways to approach this in my humble opinion :

1) you could use a post expression based on the step.result.buttonhit and set the Runstate.SequenceFailed property to true.

(e.g. if the first button was pass and the second button was fail :

Runstate.SequenceFailed = (Step.Result.ButtonHit==2)

This is brute force and if you have the property of the sequence it's in set to "goto cleanup on sequence failure" this doesn't trigger it.

 

2) Use the status expression of the step and set the Step Failure causes Sequence Failure flag (in the run options of the step)

e.g. in the status expression box :

Step.Result.Buttonhit==1?"Passed":"Failed"

 This does trigger the "goto cleanup on sequence failure" and by default you'll also have the result of the step to go into the report so you can see it was that one that caused the failure chain.

 

Also, if you using TS 4.x, you might want to copy that Message Popup into the templates area so you can re-use it!

 

Hope that helps

Thanks

Sacha Emery

Systems Engineer (NIUK)

// it takes almost no time to rate an answer Smiley Wink
Message 3 of 3
(3,285 Views)