【问题标题】:Appium can not find elements in Android after device popup or activity设备弹出或活动后,Appium 无法在 Android 中找到元素
【发布时间】:2018-12-12 13:53:34
【问题描述】:

我正在使用 Appium 1.8.1 来自动化我的 Android 应用程序。

当出现任何设备警报时,在我单击该弹出窗口的确定按钮后,Appium 停止查找元素。

目前我在出现任何弹出窗口后运行代码以重新启动应用程序,之后它可以工作,但我需要适当的解决方案,因为根据我的理解,重新启动应用程序不是解决方案。

【问题讨论】:

  • 只是一种解决方法,您不必重新启动应用程序。您可以改为将应用程序置于后台,然后将其置于前台,它就会工作。我也有同样的问题。这种解决方法对我有用。
  • 谢谢 Vighnesh,我无法正确表达,但它没有重新启动,我正在做同样的 driver.runAppInBackground(2);这就是解决方法,但我需要 appium 团队的一些解决方案。
  • 是的。完全同意。 github页面上已经有一个错误。期待 appium 团队的修复

标签: appium android-alertdialog ui-automation appium-android


【解决方案1】:

在 Python 中:

driver.switch_to_window(driver.window_handles[0])

【讨论】:

    猜你喜欢
    • 2020-02-10
    • 2016-10-23
    • 2018-11-17
    • 2015-06-22
    • 2020-05-05
    • 2019-06-23
    • 1970-01-01
    • 2018-06-04
    • 1970-01-01
    相关资源
    最近更新 更多