问题描述
试图自动执行可滑动的底部工作表,但是无法找到弹出窗口元素。任何人都有如何自动执行可滑动底部弹出窗口的解决方案。 “关闭”按钮找不到。
[UiAutomator的图像]
解决方法
我认为您在问两个问题,所以我们开始吧。
-
如何自动执行可滑动底部弹出窗口
自动执行弹出窗口的最简单方法是单击“打开”按钮。但是我想您实际上是想将按钮向上拖动。
一个Java演示:
WebElement srcEl = driver.findElement(By.xpath("//android.widget.TextView[@text='Controlled bottom sheet']"));
TouchAction action = new TouchAction(driver);
// Change the coordinate position according to your actual situation
action.longPress(srcEl).moveTo(100,100).release().perform();
更多信息:http://appium.io/docs/en/writing-running-appium/touch-actions