06-19-2014 03:52 PM
Our project is using TestStand 2012 SP1.
We are using reportgen_txt.seq. and SequentialModel(.seq).
My goal is to save report files to a specific directory only when I run my Self_Test.seq.
I'm attempting to use Configure >> Report Options >> Generate Report File Path.
Setting in "Report Options" dialog >> "Generate Report File Path" tab:
Type Model: Sequential
File Name/Directory Options: Specify Report File Path by Expression
This is the expression that I'm using:
"<ClientFileName>" == "Self_Test" ? "C:\\Reports\\Self-test\\<ClientFileName>_Report[<UUT>][<FileTime>][<FileDate>]<Unique>.<FileExtension>" : "C:\\Reports\\<UUT>\\<ClientFileName>_Report[<UUT>][<FileTime>][<FileDate>]<Unique>.<FileExtension>"
The statment passes syntax check with "no errors".
Running Self_Test.seq using the sequence editor, the report file always goes to path in Red.
Is there a method to accomplish this?
Solved! Go to Solution.
06-19-2014 04:21 PM
Do you need to add .seq to Self_Test in your conditional statement? That would be my guess. It's never evaluating to true because .seq isn't there.
06-19-2014 06:36 PM
Thanks for replying jaggawax,
I tried that, didn't work. So I tried modifying the setting to use a function from the f(x) palette:
!StrComp("<ClientFileName>", "Self_Test", 1, -1) ? "C:\\Reports\\Self-test\\<ClientFileName>_Report[<
This still eveluates to: "C:\\Reports\\<UUT>\\<ClientFileName>_Report[<UUT>
in the preview pane.
06-23-2014 10:11 AM
What comes out if you just use: "<ClientFileName>" ?
That's what you need to compare with.
Regards,
06-23-2014 11:49 AM
I think I know what's going on here. It looks like the macro (<ClientFileName>) isn't evaluated until after your string compare occurs. So you are comparing your file name to the macro (i.e. Self_Test is equal to <ClientFileName>) Unfortunately, this won't compare correctly.
I tried using an Evaluate function so the macro would evaluate first but no dice. It throws an unexpected token error.
It looks to me like the macros don't evaluate until the end no matter what I've tried. So I don't think your option is going to be valid. Maybe one of hte blues can enlighten us on this as there is not documentation out there that I can find.
06-23-2014 02:15 PM
Hi Leroy/jigg,
You are correct that the expression itself is evaluated before the Macro strings are resolved, so this approach won't work. The macros are evaluated using modelsupport2.dll (DetermineReportFilePathNameExprEx function), which first evaluates the expression before resolving the macros. For implementing a custom report file path expression for a particular client file, I would recommend overriding the ReportOptions callback, then programatically setting the report path expression, using an expression such as:
Parameters.ReportOptions.ReportFileSequentialModelExpression = "\"MyCustomLocation\\<ClientFileName>_Report[<FileTime>][<FileDate>].<FileExtension>\""
Note the use of double quotes since the field is an expression field. This approach will also allow you to use logic in the callback to change the report file path string using TestStand flow control steps.
06-23-2014 02:30 PM
Thanks AI.B,
This will work for our application.
Ssince it is only Self_Test sequence that will need this modification, I'll place the override in that sequence file.
Thanks everyone for your help.
Leroy_99