android - 如何使用 Android uiautomator 查找元素?
问题描述
我正在使用带有 Python 和 Appium 的 android uiautomator。我有以下元素,我需要找到一种方法来点击它。该元素没有唯一的 resourceId、className 或文本。
解决方案
使用Appium-Inspector获取按钮的 xPath,然后通过 xPath 定位按钮:
btn1 = self.driver.find_element_by_xpath("xpath-here")
推荐阅读
- reactjs - React - 做全局状态的正确方法是什么?
- android - Android 10 将文件写入公共 DCIM 目录,非弃用方法
- java - 可使用嵌套列表弹簧靴分页
- javascript - 为 Cart 组件添加删除按钮
- python-3.x - 由于 python 版本混乱,无法创建 pipenv 环境
- javascript - 过滤数组并在 React 中显示结果
- date - 电子邮件提醒 - 正确的时区
- java - Stripe 3DS 中的嵌套 iframe - 无法使用 Selenium/Serenity 附加到它们
- javascript - 节点js中的强大问题
- express - 当用户是 auth、express、jwt、cookie-parser 时在页面上显示数据