Why this button, in my opinion, cannot be noticed by UIAutomation?

I can see the view, but I can not see / click the button inside it. The button has a UIA_loginview_loginbutton accessibility tag with accessibility enabled. why doesn't it appear in logElementTree ()?

var target = UIATarget.localTarget();
var application = target.frontMostApp();
var window = application.mainWindow(); 
var view = window.elements().firstWithName("UIA_loginview_view"); 


UIATarget.localTarget().logElementTree();
UIATarget.localTarget().frontMostApp().logElementTree();


if(view == null || view.toString() == "[object UIAElementNil]") 
{
UIALogger.logFail("View not found - "+view.toString());
} 
else
{
    UIALogger.logPass("View found - "+view.toString());
    UIALogger.logMessage("View Elements length - "+view.buttons().length);
    view.buttons()["UIA_loginview_loginbutton"].tap();
}

Log Elements Tree: // Shows my view, but not the button inside it

4) UIAElement [name: UIA_loginview_view value: (null) NSRect: {{0, 20}, {320, 460}}]

+5
source share
1 answer

, . , , . "Accessability" Interface Builder, UIAutomation.

?

+12

All Articles