appium - XPath 在使用 Appium Inspector 的应用程序中是动态的
问题描述
我附上了所选元素的屏幕截图
我正在为 iPhone 进行移动应用程序测试,我正在使用 Appium 检查器来识别元素,我有一个场景,机器人在与机器人聊天时回复文本,所以我需要识别首先是文本,因为我只有xpath ,并且一直在变化,除了xpath我还有属性,,,,,,,,,你type
能告诉我如何使用我提到的属性首先识别文本吗?enabled
visible
x
y
height
width
public void verify_validatation_message() {
MobileElement message = (MobileElement) driver.findElementByXPath("//XCUIElementTypeOther[@name=\"label_2\"])[62]/XCUIElementTypeOther");
String validation_message = message.getText();
Assert.assertEquals("I can see you've put a term of 45 years", validation_message);
}
解决方案
推荐阅读
- stata - 在 esttab 中结合线性和非线性回归的输出
- python-3.x - 如何在中间有 nan 的列表中找到最小和最大元素
- bash - 需要文件中的数字列。然后每个数字必须通过查找/替换 sed 转到另一个文件。问题:最终文件都有相同的编号
- wordpress - WordPress add_rewrite_rule() 显示 404 not found
- php - php:如何使嵌套的帖子在另一个中工作
- ios - 获取 20 毫秒 VoIP 应用程序的麦克风数据回调
- java - Google Cloud Datastore 过滤包含列表中项目的数据
- android - HorizontalScrollView 中的表格布局 setStretchAllColumns(true) 在 Lollipop 中不起作用
- sql-server - 无法在 Azure VM 上使用我的 dns 名称访问我的 ssrs 服务器
- c# - EF Core:无法访问已处置的对象