如何在appium中找到内部元素

时间:2016-02-13 10:44:13

标签: android xpath appium

在我的页面中,我有一些android.widget.FrameLayout我想检查android.widget.ImageView中是否存在FrameLayout以下picture {{3}}的特定元素index=1显示我的页面结构
我尝试以下代码但不工作
driver.FindElement(By.ClassName("android.widget.FrameLayout"))..FindElement(By.ClassName("android.widget.ImageView[@index='1']"));

如何获得此元素的正确xpath?

1 个答案:

答案 0 :(得分:0)

这是一个可能的XPath表达式,用于查找目标android.widget.ImageView元素:

//android.widget.FrameLayout//android.widget.ImageView[@index='1']

并确保指定正在使用的选择器是XPath(By.XPath()),而不是类名或其他任何内容。

相关问题