使用iOS模拟器的辅助功能检查器中不显示辅助功能标识符 [英] Accessibility Identifier not visible in Accessibility Inspector with iOS Simulator

查看:202
本文介绍了使用iOS模拟器的辅助功能检查器中不显示辅助功能标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用辅助功能检查器来验证我在模拟器(iOS 9.2)中运行的应用程序中的所有辅助功能标识符。



可访问性检查器能够返回多个可访问性字段,但不能返回标识符。



有人知道为什么以及如何看到它们吗?

解决方案

您将永远无法(无来自Apple的更改)在Accessibility Inspector中看到此属性,因为它不是真正的用于辅助功能。它与可访问性相关联是一个误称,与可访问性API在识别要使用UI Automation进行自动化测试的元素时的通用值有关,因为可访问性信息可在整个过程中获得。要获取此信息,您可以将UI元素转换为 UIAElements 并访问 name 属性,并将其传递给NSLog。 / p>

编辑:是的,看看萨利赫的答案。苹果在某个时候添加了这个!警惕依赖于此,最近对我而言,Accessibility Inspector一直存在很多错误和不稳定。但是,如果您3年前不回答,那么该答案就是可以接受的答案!


I wanted to use the Accessibility Inspector to verify all the accessibility identifiers in my app running in the simulator (iOS 9.2).

Accessibility Inspector is able to return multiple accessibility fields but not the identifiers.

Any idea why and how I could see them ?

解决方案

You will never be able to (without changes from Apple) see this property in Accessibility Inspector, because it isn't really used for accessibility. That it is associated with accessibility is a misnomer, related to accessibility API's generic value in identifying elements for automated testing using UI Automation, because accessibility information is available cross process. To get this info you could cast UI elements to UIAElements and access the name property, and pass this to NSLog.

EDIT: Yep, look at Saleh's answer. Apple added this at some point! Be wary about relying on this, Accessibility Inspector has been very buggy and unstable for me recently. But that answer would be the accepted answer if you're not answering this 3 years ago!

这篇关于使用iOS模拟器的辅助功能检查器中不显示辅助功能标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆