【问题标题】:How to put app in background and back to foreground using Selenium on iOS devices?如何在 iOS 设备上使用 Selenium 将应用程序置于后台并返回前台?
【发布时间】:2017-04-13 07:37:49
【问题描述】:

对于iOS 9.3 和ios 10.0,如何将应用程序置于后台并在Appium iOS 中重新启动? 我试过 runInBackground(10) 但它只适用于Android 不适用于iOS

【问题讨论】:

  • 我们是使用 selenium 在不同版本(ios 9.3 和 ios 10.0)上自动化 ios 应用程序,这里我们必须在关闭应用程序和打开应用程序后验证会话。
  • 修改问题,代码格式

标签: ios background appium device foreground


【解决方案1】:

要将应用程序置于后台 10 秒,请遵循以下语法: driver.runAppInBackground(Duration.ofSeconds(10));

更多详情请关注:

https://appium.github.io/java-client/io/appium/java_client/InteractsWithApps.html#runAppInBackground-java.time.Duration-

https://appium.readthedocs.io/en/latest/en/commands/device/app/background-app/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-29
    相关资源
    最近更新 更多