Quantcast
Channel: Windows Desktop Development for Accessibility and Automation forum
Viewing all articles
Browse latest Browse all 585

UI automation cannot find an element. Inspect Object can.

$
0
0

Hi,

I'm attempting to grab a particular control using UI automation.  The Inspect Object tools shows the control in the appropriate tree, and I can even navigate to it and have it be highlighted, but my code can't see it.  Here's the code (where 'root' is the parent of the control):

System.Windows.Automation.

Condition elementPropCondition = newPropertyCondition(AutomationElement.AutomationIdProperty, id, PropertyConditionFlags

.IgnoreCase);

 

AutomationElement theElement = root.FindFirst((TreeScope.Element | TreeScope.Descendants), elementPropCondition);

Any ideas?

 

Viewing all articles
Browse latest Browse all 585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>