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

BUG C# - AutomationElement.FromPoint

$
0
0

I am convinced that AutomationElement.FromPoint in C# has a BUG. When using AutomationElement.FromPoint, it does not return the correct automation object. To reproduce this, run IE11, run the google.com page. Then run inspoect.exe from the Windows SDK. Inspect.exe will see the seach prompt, and will denote its BoundingRectangle. Then write a simple C# app that call AutomationElement.FromPoint on a screen point in the google's search prompt. Be sure to put the call into a separate thread, as per UI-automation Thread Issues (see https://msdn.microsoft.com/en-us/library/ms788709(v=vs.110).aspx ).

The object returned will not be the search prompt, but rather it will find an element, that is about 3 parents above the search prompt that is of ClassName "Internet Explorer_Server".

In inspect.exe, use the "Cursor" event handler, and click on the google's search prompt, and it will show that the "Internet Explorer_Server" element is 3 parents above the search prompt.

To ge the correct element, one will have to traverse up the UIA's tree, and then down, to get the lowest element that contains the point, and is visible.

This BUG has been logged by another here: http://stackoverflow.com/questions/34986741/automationelement-frompoint-gets-the-wrong-element


Viewing all articles
Browse latest Browse all 585

Trending Articles



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