NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add UUTStatus (Passed, Failed) to Reports?

Solved!
Go to solution
  1. What process model are you using?
  2. Are you starting the test with the process model?
  3. Have you put a breakpoint in ReportOptions callback to verify that the variable updates?
  4. Are using a Statement expression step to update the variable?

 

My testing shows the variable updates correctly and that I end up with a file named "Report_Passed.xml" in the correct folder.

0 Kudos
Message 11 of 14
(455 Views)

@ee-jallen wrote:
  1. What process model are you using? -> Sequential and Batch model
  2. Are you starting the test with the process model? -> start as SinglePass
  3. Have you put a breakpoint in ReportOptions callback to verify that the variable updates? -> Yes it updates
  4. Are using a Statement expression step to update the variable? 

 

My testing shows the variable updates correctly and that I end up with a file named "Report_Passed.xml" in the correct folder.


in the reportoptions callback I am using this expressions:

Parameters.ReportOptions.ReportFileSequentialModelExpression = "\"" + StationGlobals.ReportDirectory + "\\\\" + Parameters.ReportOptions.BaseName + "_$(UUTStatus).$(FileExtension)" + "\"",
Parameters.ReportOptions.ReportFileBatchModelExpression = "\"" + StationGlobals.ReportDirectory + "\\\\" + Parameters.ReportOptions.BatchBaseName + "_$(UUTStatus).$(FileExtension)" + "\"",
Parameters.ReportOptions.ReportFileParallelModelExpression = "\"" + StationGlobals.ReportDirectory + "\\\\" + Parameters.ReportOptions.BaseName + "_$(UUTStatus).$(FileExtension)" + "\"",
Parameters.ReportOptions.BatchFileBatchModelExpression = "\"" + StationGlobals.ReportDirectory + "\\\\" + Parameters.ReportOptions.BaseName + "_$(UUTStatus).$(FileExtension)" + "\"",

 

 

When setting a breakpoint I see that those variables are updated with the correct path like this:

...MainReport_$(UUTStatus).$(FileExtension)

 

The generated report name comes like this at the end:

.. [25 04 2023].xml.html

 

 

So the Basename is correct with the date but it somehow ignores the $(UUTStatus) completely.

 

 

 

 

0 Kudos
Message 12 of 14
(441 Views)
Solution
Accepted by topic author Norick17

You can't put UUTStatus in the Batch report name:

Parameters.ReportOptions.BatchFileBatchModelExpression = "\"" + StationGlobals.ReportDirectory + "\\\\" + Parameters.ReportOptions.BaseName + "_$(UUTStatus).$(FileExtension)" + "\""

 

Reports can have UUTStatus but Batch Report cannot; and that makes sense because the batch report contains all of the statuses of the sockets being tested.

 

You would know this if you used the GUI to set the expressions for your reports, the macro is missing from the list.

eejallen_0-1682437945008.png

 

I still don't understand why you are needing to set expressions during runtime.  Why not just set the expressions in the Report Options?  It would guarantee that you don't make any mistakes.

Message 13 of 14
(435 Views)

I can not use the GUI because I need to set the path during runtime.

 

Anyway, thank you for the solution which I fully understand now!

0 Kudos
Message 14 of 14
(414 Views)