我是移动自动化和Appium的新手,无法找到获取xpath或定位元素的方法,在uiautomatorviewer
中获取了以下节点详细信息:
index:0
text:
resourceid:
class: android.view.View
package: com.divami.balfour
Node Details and Tree structure in uiautomator
元素文本字段的节点树结构和节点详细信息图像
发布于 2015-05-19 01:12:55
您可以通过类名和索引对其进行过滤:
driver.findElementByXPath("//*[@class='android.view.View' and @index='0']");
发布于 2015-05-18 04:04:11
根据您的图片,xpath必须是这样的
//android.widget.FrameLayout[0]/android.webkit.WebView[0]/android.widget.View[0]/android.widget.View[2]/android.widget.EditText[1]
我不确定我创建的是不是正确的,但我希望你能理解这个想法。如果这仍然不起作用,请从应用程序中获取页面源代码(xml格式)。然后将源代码复制到xpath tester web服务。
https://stackoverflow.com/questions/30279788
复制相似问题