-
Notifications
You must be signed in to change notification settings - Fork 8
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
Implement Get Element Attribute. #27
Conversation
Currently failing and I'm not sure why.
The test for this feature is currently failing, even though in another scenario it works fine. I think (but I'm not sure) that it's because it's using |
Yep, confirmed that the problem is the |
This allows the `Get Element Attribute` test in FlaUI#27 to work. Seems like Selenium.WebDriver tries to execute a script in order to read attributes?
e7f6666
to
5952e4e
Compare
I did a quick test, I am OK converting the tests to use Appium.WebDriver, but I think keeping the freedom to use Selenium.WebDriver as a user is also good. Can we document both options in the README? I.e. we should document that Selenium.WebDriver's |
Can we add a little explanation to the README about attributes and properties and their difference (if there is any)? Adding it to the WebDriver interpretation section would make sense to me. @Roemer Do you have suggestions of attribute vs. property interpretation, is there a difference or are they the same for Windows UI automation elements? Is there a documentation from Microsoft on which attributes are supported on Windows UI automation elements? If so, it would be good to refer to it in the README. |
`Selenium.WebDriver`'s `GetAttribute` tries to run a script on the server. `GetDomAttribute` works as we need and allows the test to pass.
Ah! Yes that works! Ok then I think #28 is unnecessary for the moment then. I've pushed a change to the test to use |
Added support for pattern properties. I think this PR should be ready for review now.
Sure, though I'm not sure I'm the right person to write that ;) From what I understand in WinAppDriver, attributes simply map to UIA element properties and pattern properties if they're in the form
I'm not sure there is... I can't remember where I found out about it but I assume it was StackOverflow. |
@Roemer Is this the right link to reference for UIA3 automation element properties? https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-automation-element-propids |
@aristotelos you didn't ask me, but I believe that is the correct link for the UAI3 properties, yes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the build check warnings: "The annotation for nullable reference types should only be used in code within a '#nullable' annotations context."
Fixed. Any reason the tests aren't using |
No, no good reason, so a PR to change that is welcome. |
…-doc Document interpretation of attribute in README
@aristotelos grokys#1 merged, thanks for doing that! EDIT: Also added some docs about how attributes map to UIA properties. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with one minor test naming suggestion
Co-authored-by: aristotelos <arisvd@gmail.com>
Thanks, applied! |
Implements
/session/{session id}/element/{element id}/attribute/{name}
.Not so crazy about using reflection here, but it seems it's the only way to get the property ID from a string?
Fixes #25
TODO
Pattern.Property
attributes as supported by WinAppDriver (e.g. https://github.com/microsoft/WinAppDriver/blob/master/Tests/WebDriverAPI/ElementAttribute.cs#L69)