使用Appium IOS自动化的Java:使用的无障碍标识获取元素? [英] Appium IOS automation using Java : get element using accessibility Id?

查看:639
本文介绍了使用Appium IOS自动化的Java:使用的无障碍标识获取元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的IOS自动化使用appium。我可以访问元素和使用XPath这样做自动化

<$p$p><$c$c>driver.findElement(By.xpath(\"//UIAApplication[1]/UIAWindow[2]/UIASecureTextField[3]\")).click();

我想访问使用特定的辅助标签名称的元素。当使用appium检查我可以看到,辅助功能名称是参数下显示的。但如何使用Java code访问这个值?

感谢。


解决方案

您应该能够使用findElementByAccessibilityId(字符串使用)方法在Java中。它更多资讯:

http://appium.github.io/java-client/io/appium/java_client/FindsByAccessibilityId.html

I am new to IOS automation using appium. I can access elements and do automation using XPath like this

driver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[2]/UIASecureTextField[3]")).click();

I would like to access elements using the accessibility label name given. When using the appium inspector I can see that the accessibility name is displayed under the parameter Value . But How to access this value using Java code?

Thanks.

解决方案

You should be able to use the findElementByAccessibilityId(String using) method in Java. More info on it here:

http://appium.github.io/java-client/io/appium/java_client/FindsByAccessibilityId.html

这篇关于使用Appium IOS自动化的Java:使用的无障碍标识获取元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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