This article describes how to access node attributes through the SystemWeaver API. This is especially relevant when working with the Test solution as test results are saved as node attributes. Prior to working with nodes in this way, we recommend that you are familiar with the concept of nodes in SystemWeaver


Example Meta model

            // Get the top of the Node tree, from a Test
            IswNode testTopNode = testItem.TopNode;
           
            // From the test, get the SubNode(s) for the Test Specification.
            foreach (IswNode testSpecNode in testTopNode.GetSubNodesOfSID("ISSP"))
            {
                // From the Test Specification, get the SubNodes for the Test Cases.
                foreach (IswNode testCaseNode in testSpecNode.GetSubNodesOfSID("ITEC"))
                {
                    // Get the Item name of the Test Case that that the Node belongs to.
                    string itemName = testCaseNode.Item.Name;
                    // Get the Attribute from the Node
                    IswAttribute attr = testCaseNode.Attribute("PTCS");

                    // If there is a value, get it
                    if (!attr.IsNil)
                    {
                        string nodeAttrValue = attr.ValueAsString;
                    }
                }
            }
Note: When updating the Test Case Status node attribute, be sure to update the node with the correct TopNode. The correct TopNode is the one retrieved through the Test which has item type="JSES". When using the correct TopNode, the results will display in the hard-coded test-related views, e.g., Result grid, Result history