我能够看到视图,但无法看到/点击其中的按钮。该按钮的可访问性标签为 UIA_loginview_loginbutton 并启用了可访问性。为什么它没有显示在 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();
}
日志元素树://显示我的视图,但不显示其中的按钮
4) UIAElement [name:UIA_loginview_view value:(null) NSRect: {{0, 20}, {320, 460}}]