GetChildren() public method

public GetChildren ( ) : AutomationElement[]
return AutomationElement[]
Ejemplo n.º 1
0
        //---------------------------------------------------------------------------
        // Do child automation elements matching the calling range?
        //---------------------------------------------------------------------------
        static internal void TS_IsMatchingRangeChildren(TextPatternRange callingRange, TextPatternRange cloneRange, CheckType checkType)
        {
            int misMatch = 0;

            if (callingRange.GetChildren().Length != cloneRange.GetChildren().Length)
            {
                Comment("Calling range has " + callingRange.GetChildren().Length + " child elements");
                Comment("Cloned  range has " + cloneRange.GetChildren().Length + " child elements");
                ThrowMe(checkType, "Cloned range has mis-matched # of child automation elements from calling range");
            }

            for (int i = 0; i < callingRange.GetChildren().Length; i++)
            {
                if (callingRange.GetChildren()[i] != cloneRange.GetChildren()[i])
                {
                    misMatch++;
                    Comment("Mismatched child elements[" + i + "]");
                    Comment("   calling range child element " + i + " runtime id = " + callingRange.GetChildren()[i].GetRuntimeId().ToString());
                    Comment("   cloned  range child element " + i + " runtime id = " + cloneRange.GetChildren()[i].GetRuntimeId().ToString());
                }
                else
                    Comment("Child elements [" + i + "] match");
            }

            if (misMatch > 0)
                ThrowMe(checkType, misMatch + "/" + callingRange.GetChildren().Length + " mis-matched child elements, should be no mismatches");
            else
                Comment("All child elements match in both calling and cloned ranges");
            m_TestStep++;
        }
Ejemplo n.º 2
0
        //---------------------------------------------------------------------------
        // Wrapper for TextPatternRange.Children Property
        //---------------------------------------------------------------------------
        static internal void Range_GetChildren(TextPatternRange callingRange, ref AutomationElement[] children,
                                CheckType checkType)
        {
            string call = "TextPatternRange.Children";

            if (callingRange == null)
                throw new ArgumentNullException(call + " requires non-NULL TextPatterncallingRange");

            children = callingRange.GetChildren();

            if (children == null)
                ThrowMe(checkType, "TextPatternRange.Children should not return NULL ");

            Comment("Property " + call + " returned array size " + children.Length);

        }