northwoodspd / uia

A ruby gem for interacting with automation elements in Windows
MIT License
17 stars 4 forks source link

Finding by RuntimeId in Windows 8 #5

Closed leviwilson closed 10 years ago

leviwilson commented 10 years ago

Problem

The last enhancement to uia was trying to be smarter about finding elements by runtime_id by utilizing the sections of the runtime_id to try to figure out what its parent might be. So, for [42 12345 0 2], the idea was that 12345 indicated the parent so it can scope the search to that element.

On Windows 8, this is not working because IsWindow is returning TRUE for 42, when the actual parent is 12345.

Proposed Solution

uia should try to use any potential candidates from the runtime_id until it can find the desired element. If none are candidates or none are found, it should use the AutomationElement.RootElement as the base of the search (like it did before).