【问题标题】:Alternative of accessibilityLabel to be used by Appium for React Native appsAppium 用于 React Native 应用程序的 accessibilityLabel 的替代方案
【发布时间】:2020-08-31 10:07:50
【问题描述】:

我们有多个 React Native 应用程序,我们正在使用 Appium web-driver 通过添加 accessibilityLabel 轻松识别元素,因此我使用该应用程序的语言环境并不重要,但现在我们收到了很多来自客户的抱怨iOS系统正在使用accessibilityLabel来帮助残障用户。例如,Voice Over 使用此功能,如果您为此设置一些测试值,您的残障用户将受到影响。

我们也不能使用 byText 因为本地化的原因它不是最优的,现在我们的 React Native 开发团队要求我们为 accessibilityLabel 提供替代方案,有什么建议吗?

【问题讨论】:

    标签: react-native automated-tests appium ui-automation appium-ios


    【解决方案1】:

    对于 React Native 中的 iOS,您可以使用 testID,而对于 android,据我所知,accessibilityLabel 是唯一的方法。 所以通常是这样的:

    testID= {"ElementId"}
    accessibilityLabel= {"ElementTextDesc"}
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-11-10
    • 2019-03-16
    • 2020-09-29
    • 1970-01-01
    • 1970-01-01
    • 2019-12-18
    • 1970-01-01
    相关资源
    最近更新 更多