public void Descendant()
        {
            var listView = window.Get <ListView>("listView");
            var finder   = new RawAutomationElementFinder(listView.AutomationElement);

            Assert.AreNotEqual(null, finder.Descendant(AutomationSearchCondition.ByControlType(ControlType.HeaderItem).OfName("Key")));
            Assert.AreEqual(null, finder.Descendant(AutomationSearchCondition.ByControlType(ControlType.Header).OfName("Key")));
        }
 public void DescendantTest()
 {
     using (var window = StartScenario("OpenListView", "ListViewWindow"))
     {
         var listView = window.Get <ListView>("ListView");
         var finder   = new RawAutomationElementFinder(listView.AutomationElement);
         Assert.That(finder.Descendant(AutomationSearchCondition.ByControlType(ControlType.HeaderItem).WithName("Key")), Is.Not.Null);
         Assert.That(finder.Descendant(AutomationSearchCondition.ByControlType(ControlType.Header).WithName("Key")), Is.Null);
     }
 }