public static void TextPatternRangeFromChildGood(AutomationElement element)
{
object patternObj = null;
if (GetPatternObject(element, TextPattern.Pattern, ref patternObj))
{
TextPattern pattern = (TextPattern)patternObj;
Dump("TextPattern.GetVisibleRanges", true, element);
try
{
AutomationElementCollection collection = element.FindAll(TreeScope.Subtree, Condition.TrueCondition);
object property = pattern.RangeFromChild(collection[_rnd.Next(collection.Count)]);
}
catch (Exception exception)
{
VerifyException(element, exception,
typeof(ElementNotAvailableException),
typeof(InvalidOperationException));
}
}
}