NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create an execption in testplan?

Hello,

is there a way to create an exeption with the onbard steps of teststand?

Reason: I am using a custom OPUI and want to test its behaviour when an exception in the testplan occurs.

Thanks

0 Kudos
Message 1 of 3
(2,310 Views)

What do you consider to be an "exception"?

That term does not exist in the API of TS. What i think comes close to your 'exception' is the occurrance of a runtime error. There is a UI Message called UIMsg_RuntimeError (code 45) which should do something close to what you are looking for.

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

Hello,

simply use a post expression for the step which should generate an error:

 

Step.Result.Error.Code = 42,
Step.Result.Error.Msg = "Forced error message",
Step.Result.Error.Occurred = true

 

It will cause a UIMsg_RuntimeError to be sent to your custom user interface.

0 Kudos
Message 3 of 3
(2,240 Views)