android - 在 Android 日期选择器中选择值后无法定位其他元素

标签 android selenium datepicker appium

enter image description here enter image description here我们正在使用 Selenium、Apppium 和 Java 自动化移动应用程序。

在移动应用程序(Android)中,从日历(弹出)中选择一个日期值并单击 SET 按钮。

在这一步之后,appium 变得没有响应,无法执行任何其他操作,也不显示任何错误消息。 当我在应用程序上手动执行操作时,应用程序和 appium 会响应并且错误显示为,

Returned value cannot be converted to WebElement: {stacktrace=NoSuchElementError: An element could not be located on the page using the given search parameters.

Date Picker class: android.widget.DatePicker

SET button class: android.widget.ScrollView

供引用的共享应用代码 fragment 。

有人可以建议如何解决这个问题。

最佳答案

有一个open issue使用 appium:解除警报后,appium 不再检测任何字段。

解决方法:

  1. 您可以将应用置于后台并再次启动。 driver.runAppInBackground(5);

  2. 在打开对话框之前获取屏幕上任何元素的坐标 (x, y) 与对话框交互(例如选择元素、关闭等) 关闭对话框后按坐标(x,y)点击: new TouchAction(driver).tap(x, y).perform();

关于android - 在 Android 日期选择器中选择值后无法定位其他元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51299167/

相关文章:

javascript - UI日期选择器代码格式

Android Miracast 协议(protocol)源代码

google-chrome - 如何使用 Selenium 登录 Chrome?

java - 在 Selenium Webdriver 中,如何在元素后获取文本?

python - 消息: Element <option> could not be scrolled into view while trying to click on an option within a dropdown menu through Selenium

c# - DatePickerTextBox 切换日月

c# - Jquery datepicker选择的日期未分配值

java - <service> MyFirebaseInstanceIdService 未在 list 中注册

android - 如何将 NFC API 与 Android 版谷歌浏览器一起使用

java - getDownloadUrl();给出错误(无法解析符号)?