NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I Generate two different reports from single execution of Test cases in NI teststand

Solved!
Go to solution

Hi,

My requirement is to generate two different reports from NI teststand. One for the Logging of error descriptions and the other report is by default generated by the Teststand. How can i generate a txt file that contains error descriptions other than that mentioned in the default report?

0 Kudos
Message 1 of 5
(3,605 Views)

You can create ProcessModelPostStepRuntimeError callback in your Process Model and put whatever steps there to log your error descriptions in a file.

Creating SequenceFilePostStepRuntimeError callback in your sequence file will give you a smaller scope of just one sequence file.

Other way, if you need to log errors not for all but just for sertain steps, make step types for these steps and create post-step for them which will log errors.

0 Kudos
Message 2 of 5
(3,527 Views)

Thank you for your reply,

 

I have two sequence files where i have to log the error for every steps and i cannot use callbacks based on your input. Can u please elaborate the "other way" which u have mentioned in your reply. 

0 Kudos
Message 3 of 5
(3,513 Views)
Solution
Accepted by topic author Vicky86

Do you need to do that just for these two sequences but not for other sequences? I don't see a problem to use SequenceFilePostStepRuntimeError. Create this callback in both sequence files and configure them to log into the same file. SequenceFilePostStepRuntimeError callback is called after each step of the sequence file if it has runtime error. You can access the calling step error information via RunState.Caller.Step.Result.Error property. Take a look to attached example.

 

The "other way" is useful if you need to log errors not for every step of the sequence file, but for some of them. This is more complex, because you need to create a custom step types for these steps. For the custom step you can create substeps (post-step in your case) which will be executed every time after step of this type executed. Then, this is you job to determine if error happened in the step, acces to step's error information is via Step.Result.Error property. 

Also, be aware that step's post-expression is not executed in case of error in the step.

 

Substeps.PNG

Message 4 of 5
(3,502 Views)

Thank you, the explanation was pretty much clear. My problem is in the next part i.e logging of the errors in a txt file. I created a dll using CVI, that contains a file ptr to open, append and close the file. This found feasible to me since i could generate the error log the way i wanted(Writing the details of each error code in a different para, and so on). Can i make it using NI teststand such that i have to get rid of the dll which i have created for logging the error? Kindly, give an example to log the error in a txt file using NI teststand.

0 Kudos
Message 5 of 5
(3,483 Views)