From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

[XML report] Created custom SequenceCall step, but cannot filter by new property

Solved!
Go to solution

I am having troubles referencing a property of a custom SequenceCall step I created.  The idea is to add a field to the SequenceCall that I can populate with a Post Expression and then filter out this SequenceCall if it matches a certain string.

 

I have attached a screen shot that should clarify things more.  What it shows is that when looking at the XML source (left) the standard property "ReportText" is inside the same "TEResult" container as my new "Profile" property.  This structure similarity is reinforced by the TestStand display of the newly created "Clemente_SequenceCall" (upper right).  However, when I try to access the text of "Profile" the entire body of the report does not render due to an error somewhere above the "CheckIfStepSatisfiesFilteringCondition()" function.  What is strange is that I can access the text of "ReportText" just fine and perform checks against it to filter out a sequence call.  The two properties and lines of code are so similar that I am stumped as to what I am missing.

 

CustomSequenceProblems.png

 

Since this is a custom property that not all steps have, do I need to first check if the Profile property exists?  Unfortunately I have no idea how to do this.  I have a feeling that it somehow relies on the "typeof" operand in javascript, but my initial attempts to compare it to "undefined" did not work...

 

Any help is greatly appreciated.  Thank you.

0 Kudos
Message 1 of 2
(3,551 Views)
Solution
Accepted by topic author MatthewHaentschke

Just as I suspected.  I have to make sure the Profile object exists before I start using its methods.

 

var profile = node.selectSingleNode("Prop[@Name='Profile']/Value");
var profileString='';

if (profile)  //null objects return false
profileString=profile.text;  //now that we are sure its the object we expect, call a string function on it

//Now you can test against the read Profile string.

 

0 Kudos
Message 2 of 2
(3,537 Views)