Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MsUia: ControlType "Button" not recognized if it is not in the class name #79

Closed
leviwilson opened this issue Oct 30, 2013 · 5 comments
Closed

Comments

@leviwilson
Copy link
Collaborator

Description

With the :ms_uia adapter, if you have an AutomationElement with the control type of Button, but the class name does not have 'button' in it, you cannot interact with it.

Proposed Solution

Remove the DEFAULT_LOCATORS definition since it is already checking the control type property to determine that it is a button.

@leviwilson
Copy link
Collaborator Author

The problem goes a bit deeper than this. Removing the DEFAULT_LOCATORS will work for an individual Window#button call, but for Window#buttons this breaks down, since that will depend on Win32 to locate the Windows that have the class name with /button/i. There is an inconsistency. This will affect both Window#buttons and Window#text_fields.

@jarmo - would you like me to create a separate issue for the #buttons / #text_fields issues? I can fix this issue, but it breaks buttons_spec.rb (only for :ms_uia though)

@jarmo
Copy link
Owner

jarmo commented Oct 30, 2013

Hmm, i would be in favor of removing DEFAULT_LOCATORS altogether from ms_uia if there's a better way to determine if something is a button or not. In win_32 solution like this seemed to be the only viable way.

#buttons might retrieve all the buttons which are buttons - maybe some similar solution could be used as for SelectList#options - retrieve all elements and then filter by type at Ruby side. Or retrieve only elements with correct type in the first place.

@leviwilson
Copy link
Collaborator Author

The better way is to use the control type property, which it already does. The caveat with this is that there's nothing (currently) in there to do this. I have ideas for this though, and it would fulfill #73 and #74.

@jarmo
Copy link
Owner

jarmo commented Jan 9, 2016

@leviwilson any progress with this?

@jarmo
Copy link
Owner

jarmo commented Dec 29, 2017

Closing this due to inactivity.

@jarmo jarmo closed this as completed Dec 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants