Android 上的可访问性测试自动化

时间:2023-03-24
本文介绍了Android 上的可访问性测试自动化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我最近开始研究在 Android 上自动进行无障碍测试.网上没有太多信息.有没有人探索过这个或目前正在这样做?如果是这样,你能分享你的想法/方法吗?

I recently started looking into automating accessibility testing on Android. There isn't much information out there on the web. Has anyone explored this or are currently doing this? If so, can you share your ideas/approach?

似乎 Android 的 uiautomator 依赖于辅助功能的工作,但它不支持测试辅助功能.如果它依赖于 Accessibility 特性,那是否意味着是否存在可访问标签等基本验证可以通过使用 uiautomator 执行 UI 测试来完成?

Seems like Android's uiautomator relies on Accessibility features working but it doesn't support testing Accessibility. If it relies on Accessibility features, does that mean that basic validation like accessible label exists, etc. can be done by just executing UI tests using uiautomator?

这对我来说是一个新领域,所以任何信息都会有所帮助.

This is a new area for me so any information could be helpful.

推荐答案

这里有一个 伟大的介绍 Android 中的辅助功能测试.基本上可以归结为:

Here's a great introduction to Accessibility testing in Android. It basically boils down to:

  • 使用 辅助功能扫描器
  • 开启 TalkBack 并手动测试您的应用以发现听力受损问题
  • 要查找字体缩放和布局问题,请使用 Large Text李>
  • 绝对 lint 检查,但请确保没有 contentDescription 的图像"设置为 Severity = Error
  • 如果您发现或再次出现任何/所有可访问性问题,请编写 Espresso 测试以在将来违反该可访问性问题时失败
  • 对于自动化,如果需要听力受损的功能,您还需要考虑如何对某些屏幕伪影和音频分析执行视觉验证.

另外,我建议观看 此来自 GTAC 2015 的演示,了解某些人的可访问性测试很好的主题背景.

Also, I recommend watching this presentation from GTAC 2015 on accessibility testing for some great context on the topic.

对于检查可访问性的自动化测试,我非常建议从可以在跨屏幕共享的元素(菜单、布局、主题、自定义控件)中识别的问题开始.虽然它们不会捕捉到偶尔会弹出的一次性错误,但它们会解决您应用中随处发生的问题,如果您愿意的话,这是一种按数量划分优先级"的方法.

For automated tests that check for accessibility, I'd very much recommend starting with issues that can be identified in elements that are shared across screens (menus, layouts, themes, custom controls). While they won't catch the one-off errors that will occasionally pop up, they'll address issues that happen everywhere in your app, a 'prioritize by volume' approach if you will.

此外,如果您的团队使用 Android Studio,那么您肯定希望能够编写驻留在代码中的 Espresso 测试.QA 是开发过程的一部分.除非有一些合法的博洛尼亚要处理,否则访问您的测试所在的子文件夹应该不是问题.例如,将 'androidTest' 文件夹拆分为 子模块 作为测试人员,您拥有拉/推权限,但只能读取应用程序其余部分的权限,因此您可以自己编译和运行.如果您正在编写 Appium 测试,可能更难要求您的开发团队在构建期间将它们作为自己的 BVT/smoke 测试过程的一部分运行,但并非闻所未闻.

Also, if your team uses Android Studio then you definitely want to push for the ability to write Espresso tests that reside with the code. QA are part of the development process, period. Getting access to a subfolder where your tests reside shouldn't be a problem unless there some legal bologna to deal with. For instance, split out the 'androidTest' folder as a submodule where you have pull/push rights as a tester, but only read rights to the rest of the app so you can compile and run yourself. If you're writing Appium tests, it may be harder to ask your dev team to run them as part of their own BVT/smoke test process during builds, but not unheard of.

至于视觉分析和音频注入/确认,这些是您可能需要使用某些服务或商业工具的高级功能为.

As for visual analysis and audio injection/confirmation, these are advanced capabilities that you'll probably need to use some service or commercial tool for.

祝你好运!

这篇关于Android 上的可访问性测试自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

上一篇:使用 gradle 进行 Android 仪器测试的命令行参数 下一篇:Appium : 能否用于跨平台应用测试

相关文章