From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

obtaining step number in the report of teststand

Solved!
Go to solution
when we make  a sequence which has more than hundred steps for testing. After execution it becomes some what difficult to know in the report where we are i.e, at which step we are and which step condition we are checking.What i wanted to know is that is there any way that step numbers are obatined along with the steps in the report when ever we run the sequence.
0 Kudos
Message 1 of 10
(4,908 Views)

Hello,

 

You can get the step number from the Step.StepIndex property. (Link to help: http://zone.ni.com/reference/en-XX/help/370052G-01/tsapiref/reftopics/step_stepindex_p/)

 

If you are using TestStand 4.1 you can use the new Additional Results tab to add this value to your report. (More information in the TestStand help: http://zone.ni.com/reference/en-XX/help/370052G-01/tsref/infotopics/pane_additional_results/

 

If you are using a previous version of TestStand it is a little more complicated to add to the Report, but we have an article that explains the process and has an example.

Understanding and Modifying Result Collection

http://zone.ni.com/devzone/cda/tut/p/id/4428

Modifying Result Collection

http://zone.ni.com/devzone/cda/epd/p/id/4621

 

Let me know if you have any questions.

Kristen
National Instruments
0 Kudos
Message 2 of 10
(4,874 Views)

thanks for your reply .

I am using teststand 3.5, i have made round 15 sequences. the way or the the techniques you have said will apply to when we are making new sequences .But if the sequences are already made and now implementing these techniques suggested by you will be  tedious process.

As i wanted to show up the numbers in the report itself, i want to know is there any way that by modifying the coding in side the "report.xsl " file can show up the step numbers. If there i think that will be the easy process because changing only one file will effect all the sequences made. It would be helpful for me instead of going to each and every sequence and then modifying it. 

0 Kudos
Message 3 of 10
(4,841 Views)

Hello,

 

 I think the easiest thing to do if you are ok with the step index showing up in the Report Text area would be to use a post step callback to add the step index to the report text.  Since you already have sequences written you can modify the process model to do this for every sequence.  

 

This is what you'll want to do:

  •  If you are using an NI process model, copy it to the Users folder if you have not done so already so you have a backup. TestStand will then use the process model in the Users directory.
  • Open your process model (ie. SequentialModel.seq)
  • Go to Edit>>Sequence File Callbacks...
  • Add ProcessModelPostStep - This callback will be called after every step in every sequence that uses this process model
  • In this ProcessModelPostStep sequence we need to do two things:
    • Get the step index
      • Put down and ActiveX Action Step and fill out the module options:
        • Object Reference: Parameters.Step
        • Automation Server: NI TestStand API 3.5
        • Object Class: Step
        • Action: Get Property
        • Property: StepIndex
        • Create a local numeric to save the output value of the step index
    • Set the report text
      • Put down a Statement Step
      • Set the expression to: Parameters.Step.Result.ReportText = "Step Index = " + Str(Locals.StepIndex)
        • where Locals.StepIndex is the index we got in the previous step


That is all you need to do.  Save the process model and now when you run a sequence that uses that process model you will be able to see your step index displayed in the report text area of each step.

Here's a little background information on Post Step callbacks:

"How Can I Perform the Same Action After Every Step Executes?"

http://digital.ni.com/public.nsf/allkb/94149BA16C1E1C86862572A4008221FF?OpenDocument

 

And here is some information on callbacks:

"What is the Difference Between Using a "SequenceFile..." callback and a "ProcessModel..." callback?"

http://digital.ni.com/public.nsf/websearch/41FCAF4E61233DF086256BC900545466?OpenDocument

 

Please let me know if you have any questions, or run into any problems doing this.

 

Kristen
National Instruments
Message 4 of 10
(4,822 Views)

Thank you Kristen, the process explained by you did work very well.

What exacltly now happening is we need to open the step and see the setp index. Now  I will be trying to show that index number added to the name of the step so that we donteven need to open the step for knowing its index. I think this is also possible.

0 Kudos
Message 5 of 10
(4,771 Views)

Hello,

 

I'm assuming what you mean by "we need to open the step and see the step index" is that you are using the expand.xsl XML Stylesheet for your reports.  I figured out how to change expand.xsl to show the step index on the same line as the step name.

 

 Open expand.xsl, It's default location is C:\Program Files\National Instruments\TestStand 3.5\Components\User\Models\TestStandModels\StyleSheets.  You may want to save a copy of it in case you ever want to revert back to the shipping version.

 

 Search for a line that says:

<xsl:value-of select="Prop[@Name='TS']/Prop[@Name='StepName']/Value"></xsl:value-of>

 

 I added the following text right above it:

<xsl:value-of select="Prop[@Name='TS']/Prop[@Name='Index']/Value"/>
            <xsl:text> - </xsl:text>

 

That's all you need to add, so now save the stylesheet.  In TestStand make sure your report options are pointing to the stylesheet you edited by going to Configure>>Report Options...  and verify the value for StyleSheet on the Contents tab. 

 

I'm attaching my Stylesheet that I edited so if you want you can just point your report options to it.  (Be sure to save it in the same folder as the other Stylesheets so it can find the icons for the buttons).

 

Let me know if you have any questions.

 

 

Kristen
National Instruments
Message 6 of 10
(4,747 Views)

Thank you very much.

This was what exactly i wanted to do.

0 Kudos
Message 7 of 10
(4,691 Views)
Kristen i face another problem, when ever i run a for loop, each time the loop runs it comes with same index number as seperate step. Actually what i wanted was in the report i should be able to see only that there is a for loop and if i exapnd that  i should be able to see the number of times the loop has been executed otherwise if step not expanded i should be able to see only one step indicating that ther is for loop.
0 Kudos
Message 8 of 10
(4,666 Views)

Hello kpraveen,

 

The level of support we can offer at National Instruments for the XML stylesheets is limited to minor changes only, since most of us only have a little bit of experience with XML.  I think for the major changes you are talking about it would probably be in your best interest to  learn XML. If you learn it yourself you would be able to make the changes exactly the way you want it and then you'll also be able to maintain it in the future.  

 

A good starting point for learning XML is from here:

http://www.w3schools.com/default.asp

You should read over the following topics:

 XML, XML DOM, XSL, XSLT, Xpath, XQuery, XLink, Schema, JavaScript, HTML DOM, DHTML, VBscript

 

 Also, we've heard similar feedback about the stylesheets from other customers in the past.  I will be adding your name to the list of customers who have been interested in this kind of layout.

Kristen
National Instruments
Message 9 of 10
(4,634 Views)
Solution
Accepted by topic author Sury@
Thank you very much.
0 Kudos
Message 10 of 10
(4,566 Views)