我们正在使用 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 不再检测任何字段。
解决方法:
您可以将应用置于后台并再次启动。 driver.runAppInBackground(5);
在打开对话框之前获取屏幕上任何元素的坐标 (x, y) 与对话框交互(例如选择元素、关闭等) 关闭对话框后按坐标(x,y)点击: new TouchAction(driver).tap(x, y).perform();
关于android - 在 Android 日期选择器中选择值后无法定位其他元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51299167/