Appium 应用程序:无法执行“单击”操作+&引用;按钮
我正在尝试自动化一个移动应用程序,但在尝试单击“+”以添加新行数据时遇到了问题 从getsource()中,元素的代码为Appium 应用程序:无法执行“单击”操作+&引用;按钮,appium,Appium,我正在尝试自动化一个移动应用程序,但在尝试单击“+”以添加新行数据时遇到了问题 从getsource()中,元素的代码为 <android.widget.ImageButton index="0" package="mobi.littlebytes.android.bloodglucosetracker" class="android.widget.ImageButton" text="" resource-id="mobi.littlebytes.andr
<android.widget.ImageButton index="0" package="mobi.littlebytes.android.bloodglucosetracker" class="android.widget.ImageButton" text="" resource-id="mobi.littlebytes.android.bloodglucosetracker:id/fab" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" long-clickable="false" password="false" scrollable="false" selected="false" bounds="[844,1558][1038,1752]" displayed="true" />
</android.widget.RelativeLayout>
我也试过了
a.moveToElement(driver_App.findElement(By.xpath("//*[@id='mobi.littlebytes.android.bloodglucosetracker:id/fab']"))).click().build().perform();
但也失败了,即无法单击“+”按钮。希望有意见
我附上了按钮的图像
尝试使用xpath单击元素:
driver_App.findElement(By.xpath("//*[@resource-id='mobi.littlebytes.android.bloodglucosetracker:id/fab']")).click();
尝试使用xpath单击元素:
driver_App.findElement(By.xpath("//*[@resource-id='mobi.littlebytes.android.bloodglucosetracker:id/fab']")).click();
谢谢@Sameer!你能告诉我你的代码和使用“contain”方法的解决方案有什么区别吗?@Tester\u at\u工作时我没有使用
moveToElement
方法,因为元素已经出现在页面上,并且contains
将给出包含该文本的所有元素,因此,建议输入准确的文本Thank@Sameer!你能告诉我你的代码与使用“contain”方法的解决方案有什么区别吗?@Tester\u在工作中我没有使用moveToElement
方法,因为元素已经出现在页面上,contains
将给出包含该文本的所有元素,因此建议输入准确的文本