NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert a comment in Teststand Report

I'd like to insert in HTML report of Teststand 4 the same comment that I wrote in Pass/Fail Test Properties. I've already used

Parameters.Result.ReportText,

but in this way I have to write the comment twice. Does exist some class or similar to get the comment that I wrote in the Test properties?
I tried to modify the Teststand HMTM report sequence, but without success.
Do anyone some ideas to do that?
 
Thanks
Marco
0 Kudos
Message 1 of 18
(5,475 Views)

Hi,

All you have top do is in the Post Expression of the Step Properties is pass that ReportText value to the Parameters.Result.ReportText.

eg

Parameters.Result.ReportText = Step.Result.ReportText.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 18
(5,470 Views)

Ok, but I'd like to reuse the comment that I've already written in Comment section. Is it possible to recover the Comment without rewrite it in a post condition?

0 Kudos
Message 3 of 18
(5,462 Views)

Hi,

Forgive me but I may be missing something here!

You have a comment in Step.Result.ReportText and you what it to appear some where else via Parameters.Result.ReportText or maybe you want it at a different location and not bothed about it being in the Step results. It which case instead of specify the Step.Result.ReportText then write it direct to Parameters.Result.ReportText.

But if you do want it both places then you are going to have to perform some extra task. That extra task could be performing the Post Expression or create  a custom step type that already does that Post expression built in.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 4 of 18
(5,447 Views)
Corma,
 
If you are trying to put the comment of the step into your report, you can access the comment through the TestStand API, if you are using TestStand 4.0 or later, you can do this with the following expression:

Step.Result.ReportText = Step.AsPropertyObject.Comment

Josh W.
Certified TestStand Architect
Formerly blue
0 Kudos
Message 5 of 18
(5,443 Views)

Coma,

Maybe you can post a small example showing what you are trying to achive.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 6 of 18
(5,442 Views)

First of all, thanks to all...now I try to explain what I want to to.

1. In TestStand 4, in the Main Sequence, I insert a Pass/fail test.

2. In the Module Panel of Pass/fail test I link the dll and the test that I wrote in CVI

3. In Properties Panel of Pass/Fail test (in General Option) I insert a comment in the Comment Box

This is the scenario.

Now, I execute a Single Pass, and TestStand gives me a report in HTML format. I'd like that near the Step Name, appears also the comment that I wrote previously in Comment Box.

Best regard

Corma

0 Kudos
Message 7 of 18
(5,434 Views)

Hi Corma,

You can access and change the comment of a step programmatically using his PropertyObjectReference.
Namely in TS 4 the post-expression

Locals.ClonedComment = Step.AsPropertyObject.Comment

copies the comment of the actual step ( post-expression ) to a local variable named ClonedComment.

My message is use "Step.AsPropertyObject.Comment" and you should be able to programmatically control the Step comment as you prefer.

Best Regards

 

FiloP
It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong.
Richard P. Feynman
0 Kudos
Message 8 of 18
(5,404 Views)
Sorry I didn't see before.
I actually expressed with my word Josh's message.
 
Best Regards
 
FiloP
It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong.
Richard P. Feynman
0 Kudos
Message 9 of 18
(5,402 Views)

Ok, but in which way I can recall the local variables (Locals.ClonedComment) used in your file, in reportgen_html.seq ?

If I start a single pass, the comment is not displayed....sorry, but I used TS4 only from 2 week, and i'm not very skilled.... 😞

 

0 Kudos
Message 10 of 18
(5,394 Views)