NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems setting the Call TestReport report generation dir.

Hi

I have a test and I made a "report template" with the Sequence File Callbacks --> TestReport. The sequence has in its parameters strings called DirectoryType and Directory. When I change these, it has not effect. The HTML-reports are still generated to directory specified in the Report Options (current the seq. file directory).

Also, where can I find a good information package about the sequence file callbacks, especially everything that has to do with reports? I've figured them out pretty much, but it would be good to know more.

Thanks in advance,
Aleksi Sandqvist
0 Kudos
Message 1 of 13
(4,588 Views)
Hi Aleksi,

Even though you change the TestReport callback, there is still a local variable inside of the process model (SequentialModel.seq) called Locals.ReportFilePath that stores the path in which to save the report. This variable is populated by the step called "Determine Report File Path". At the end of your test, and inside of the process model, there is a step called "Write UUT Report" that uses the local variable above to determine the path to save the report. Even if you overwrite the ReportOptions inside of the TestReport callback, it is too late because the "Determine Report File Path" has already set the local variable. Therefore you must skip this step and change the local variable inside of the callback.

As for documentation, the best I can
suggest is the document called \Components\NI\Models\TestStandModels\TestStandProcessModels.PDF. You can also use the user manual for bits and pieces of info.

Hope this helps!

Bob
0 Kudos
Message 2 of 13
(4,588 Views)
Hi Aleksi,

By the time the Entry Point Test UUT's or Single Pass has reached the TestReport Callback the report path has already been set.
This is done at a Step called 'Determine Report File Path'the return value from this call is stored in Locals.ReportFilePath. The complete path being obtained from the Report Options container. This local is not passed to the Callback TestReport.
The Report Options container values are obtained in the sequenceCall Get Report Options. There is a step that reads the default setting and then calls the Override Callback ReportOptions which gives the user the options to alter the default settings at runtime.

Therefore, you need to set the report path in the Report Options container in the Callback ReportOptions.

If you needed
to set the report path at a later stage in the process model then you will have to modify the process model so that Locals.ReportFilePath can be updated with the latest value when you returned back in the process model but before the step to write the report to the file.

Other than the TestStand User Manual, the only other information is by studying the Process Models sequences, examples, information on the NI website or attending one of NI's courses.

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 3 of 13
(4,588 Views)
Hi Ray,

I still have a problem. In the report options, I have the report directory set to and in UUT i have the reports going to each sequence file's subfolder called Reports. The problem is, that TestStand creates an empty HTML-document(size 0 bytes) to the directory that is set in report options. How can I stop this from happening? It's a bit strange actually, because I can only find one step (Write report) that writes the file and it gets the modified path, so why does it create to "default" directory?

Best regards,
Aleksi Sandqvist
0 Kudos
Message 4 of 13
(4,588 Views)
Hi,

The ReportOptions.DirectoryType needs to be equal to SequenceFileDirectory.

e.g
Parameters.ReportOptions.DirectoryType="SequenceFileDirectory"

Hope this solves your problem.
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 5 of 13
(4,588 Views)
And a follow-up...

I can change the model so that i'll save all my reports to \reports\, but in the long run that may change. So I tried the ReportOptions callback, but the string "reportfilepath" value doesn't get carried to the other side (meaning the model). I tried to set a value for it, but that didn't work. The reports go the sequence file directory.

As I checked the order the actions in the model file, it seems that the values are erased for a new run, so when I use the reportOptions callback, they don't take place until the end of a UUT run, when the report file is already written. Am I missing something or...?

Best regards,
Aleksi Sandqvist
0 Kudos
Message 6 of 13
(4,588 Views)
Hi Aleksi,

The ReportOptions.ReportFilePath is not the same as the Locals.ReportFilePath found in the process model Test UUT's or Single Pass.
The ReportOptions.ReportFilePath is used if ReportOptions.GeneratePath = False. This is equivilent to setting Configure | Report Options and selecting the Specify Fixed Report Path under the Report File Pathname Tab.
If ReportOptions.GeneratePath = True then the report file path will be generated from the ReportOptions.Directory, ReportOptions.Basename and also the DirectoryType.

In the process model locals.ReportFilePath is set in the step "Determe Report Path" and this is done by determining what's been set in ReportOptions.

The easies way to solve your problem is to setup your conditions v
ia the Configure | Report Options dialog.
In the Override ReportOptions Callback comment out all your code and put a breakpoint in the ReportOptions callback. Then inspect the contains of the ReportOptions container on entry to the callback.

If you have ReportOptions.ForceFileNameToBeUnique = True then a new report file will be generated for each run. Likewise if ReportOptions.NewFileNameForEachUUT = True will also generate a new report file of each UUT.

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 7 of 13
(4,588 Views)
Hi Ray,

I looked in to this problem, and here's what I found:

There is an action in the process model that determines the report path. When I checked the C-code, I found out that the function ALWAYS creates an empty, zero-sized HTML/txt- file to the directory specified in Report Options. The Report.Save procedure is supposed to write/append to this file. But the Report.Save action can actually create the file itself. I understand that the file creation is also used for creating unique filenames etc, but couldn't they done it an easier way?

I think I'm going have add an action to the process model, that destroys the html-file. Ray, is there a way to call the command prompt from TestStand, or what do you think is the eas
iest way?

Best Regards,
Aleksi Sandqvist
0 Kudos
Message 8 of 13
(4,588 Views)
Hi Aleksi,

When the engine is closed down it should destroy any temporary files it creates automatically. Does this happen with the files you are seeing?

Ray
Regards
Ray Farmer
0 Kudos
Message 9 of 13
(4,588 Views)
Hi Ray,

No. The temporary files are destroyed. I'll try to explain what's happening. In the Report Options I've set the report directory to . I've modified the UUT Model so, that the Locals.ReportFilePath is changed to \Reports. The testreports and tempfiles are generated to the \Reports\ -directory. But I keep getting the same reportfiles (same filenames) to the sequence dir, only difference is that they are completely empty... I wanted to go through this one more time, just to be sure you understood what I was talking about?

This is happening because of the step "Determine Report File Path", because it creates the file to the path it creates ( based o
n the report options... ) during the function. The function it uses is CreateFile.

I'm working on report-dir solution for my tests. I modified the TestStand model so, that MainSequence returns with a HTMLReportPath-parameter. So, I can define a specific directory in my test. If no path is defined, the reports will go to the \reports\.

Does this seem like a good idea? Only "problem" is, that I have add a Locals.HTMLReportPath to every test I create.

Best regards,
Aleksi Sandqvist
0 Kudos
Message 10 of 13
(4,588 Views)