NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Reports Location in Dotnet interop assembly TestStand API

Hello, 

 

We are currently working on executing our tests using the TestStand API. I’ve attached an extract of our .NET code for reference, and we have a couple of questions.

Our overall objective is to manage and run tests through an Azure DevOps Pipeline and Test Plans.

  1. Does our use case align with the intended usage of the TestStand API?

  2. We would like to generate reports (XML and HTML) in a custom directory so they can be published within the pipeline. Using Report report = execution.Report; does not appear to achieve this. Is there a recommended approach to specify a custom report output location?

Thank you in advance for your support.

 

Best regards,

Thierry 

0 Kudos
Message 1 of 3
(133 Views)

Hello,

 

I have already attempted to use the ReportOptions as specified in the referenced NI documentation, as shown below.

 

// Reports Options customization
Sequence newReportOptions = sequenceFile.CreateCallbackOverrideSequence(DefaultModelCallbacks.DefModCback_ReportOptions, true);

newReportOptions.AsPropertyObject().SetValString("Parameters.ReportOptions.Directory", 0, @"C:\Workspace\Reports");
newReportOptions.AsPropertyObject().SetValString("Parameters.ReportOptions.DirectoryType", 0, "SpecificDirectory");
newReportOptions.AsPropertyObject().SetValString("Parameters.ReportOptions.Format", 0, "ATML");

int executionTypeMask = ExecutionTypeMask ...

Execution execution = engine.NewExecution(
    sequenceFile,
    sequenceName,
    seqModelFile,
    false,
    executionTypeMask);

 

Unfortunately, the reports are still not being generated in the intended directory (C:\Workspace\Reports)

 

Best Regards,

Thierry E.

 

0 Kudos
Message 2 of 3
(24 Views)

The NI examples are slightly different IMHO:

they modify the content of the Parameters from within the call back sequence.

 

What your code is doing is more or less setting the default value for the parameters. I by the time the callback is executed, those values have already been overwritten with the standard values.

 

To prove this: save your dynamically created sequence and check in the SequenceEditor using a breakpoint.

 

 

0 Kudos
Message 3 of 3
(12 Views)