04-22-2009 05:25 AM
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?
04-22-2009 08:47 AM
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
04-23-2009 07:34 AM
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)