|
Bugzilla – Full Text Bug Listing |
| Summary: | AutomationId is not implemented as what Microsoft did | ||
|---|---|---|---|
| Product: | [Mono] UI Automation | Reporter: | Rui Guo <rguo> |
| Component: | Winforms - UIA | Assignee: | E-mail List <mono-a11y-bugs> |
| Status: | NEW --- | QA Contact: | E-mail List <mono-a11y-qa> |
| Severity: | Normal | ||
| Priority: | P5 - None | ||
| Version: | Unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Other | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
Realted mono-a11y emails:
[Matt, Sep 18]
Hey, all
On Windows/MS .Net, for a winform control, the
AutomationElement.AutomationId is the name of the winform control.
So I can use following code to find a TextBox control whose name is
"txtCommand":
var txtCommand = win.FindFirst(TreeScope.Children,
new
PropertyCondition(AutomationElementIdentifiers.AutomationIdProperty,
"txtCommand"));
But with our implementation, the AutomationId becomes a integer like
"2" or "15" etc, and the former search will fail to find the textbox.
So is it OK for us to implement AutomationId like this?
BTW, since in most cases a TextBox's NameProperty is an empty string,
therefore it becomes difficult to find a TextBox without the help of
AutomationId.
[Sandy, Sep 19]
Matt,
Please file a bug about this so we can fix it in UIAutomationWinforms.
Both AutomationId and RuntimeId are incorrectly implemented there.
Also, we have code (maybe in UiaAtkBridge, too) that assumes
AutomationId should be unique (that code should instead use
RuntimeId). From MSDN:
"The AutomationIdProperty of an element is always the same in any
instance of the application on any machine, regardless of the local
language. If the property is supported by the element, the value is
unique among sibling elements but not necessarily unique on the
desktop. For example, multiple instances of an application, or
multiple folder views in Microsoft Windows Explorer, may contain
elements with the same AutomationIdProperty, such as "SystemMenuBar".
Instances of user interface (UI) elements are uniquely identified on
the desktop by their RuntimeIdProperty properties."
|
On Windows/MS .Net, for a winform control, the AutomationElement.AutomationId is the name of the winform control. So I can use following code to find a TextBox control whose name is "txtCommand": var txtCommand = win.FindFirst(TreeScope.Children, new PropertyCondition(AutomationElementIdentifiers.AutomationIdProperty, "txtCommand")); But with our implementation, the AutomationId becomes a integer like "2" or "15" etc, and the former search will fail to find the textbox. BTW, since in most cases a TextBox's NameProperty is an empty string, therefore it becomes difficult to find a TextBox without the help of AutomationId.