NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically add AdditionalResult

Hi,

I like to create a sequence file with several steps via TestStand API. This works fine.

Now I want to have Step.StdOut and Step.StdError as AdditionalResult in the Report.

 

I know how to do it in TestStand but I can't manage the same task via the C# API.

I prepare everything to get the STDOUT and STDERR stored in variables. But the last step

to get the values into the report I can't manage.


I have found the AdditionalResult class but it's a abstract class. How do I create an object of type AdditionalResult?

How do I add it to the step? Or do I have to add it somewhere else?

 

------snip--------

step = engine.NewStep("", "CallExecutable");

step.Name = classname + "." + tcname;
step.AsPropertyObject().SetValString("Executable", 0, filename);
step.AsPropertyObject().SetValString("Arguments", 0, "test.test");
step.AsPropertyObject().SetValString("ExitCodeStatusAction", 0, "EXIT_CODE_NEQ_ZERO");
pob = step.AsPropertyObject().GetPropertyObject("StdOutput", 0);
pob.SetValVariant("Dest", 0, 1);
pob = step.AsPropertyObject().GetPropertyObject("StdError", 0);

pob.SetValVariant("Dest", 0, 1);

------snip--------

 

 

Thanks for any help!

 

 

Wolfram

0 Kudos
Message 1 of 2
(4,378 Views)

See the API help for Step.AdditionalResults.

 

I think you need to do something like the following:

 

mystep.AdditionalResults.CustomResults.Insert("\"Result Name\"", "Step.StdOut");

 

Hope this helps,

-Doug

0 Kudos
Message 2 of 2
(4,353 Views)