【发布时间】:2019-08-13 23:00:02
【问题描述】:
假设我在一个 android 应用中有五个元素,它们都有各自的索引
driver.findElement(By.xpath("//android.widget.FrameLayout[@index='0']/android.widget.ImageView[@index='0']")).click();
driver.findElement(By.xpath("//android.widget.FrameLayout[@index='1']/android.widget.ImageView[@index='0']")).click();
driver.findElement(By.xpath("//android.widget.FrameLayout[@index='2']/android.widget.ImageView[@index='0']")).click();
driver.findElement(By.xpath("//android.widget.FrameLayout[@index='3']/android.widget.ImageView[@index='0']")).click();
driver.findElement(By.xpath("//android.widget.FrameLayout[@index='4']/android.widget.ImageView[@index='0']")).click();
我只想点击五个中的一个。 我会使用什么命令来实现这一点?
【问题讨论】:
标签: java android selenium automation appium