Appium 请教一个关于 XPath 定位的问题

月洒菡池 · December 01, 2015 · Last by hxh replied at March 05, 2016 · 1122 hits



driver.findElementByXPath("android.widget.RelativeLayout//android.widget.LinearLayout[2]//android.widget.LinearLayout[2]").click();

提示找不到元素,是路径不对吗

共收到 6 条回复 时间 点赞

#1 楼 @hxhapppppy 感谢~我再研究一下(:зゝ∠)

3Floor has deleted

uiautomator 获取页面元素中文乱码,机型安卓 5.0.2,请问能解决吗

#4 楼 @alisawu text 吗,ui automator viewer 的问题,可以打出来的

#1 楼 @hxhapppppy 你能写个对的吗?

#6 楼 @jiangboyang222 driver.findElementByXPath("//android.widget.RelativeLayout//android.widget.LinearLayout[1]//android.widget.LinearLayout[2]").click();或者 driver.findElementByXPath("//android.widget.RelativeLayout//android.widget.LinearLayout[@index = 2]//android.widget.LinearLayout[@index = 1]").click();

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up