如何在后台将应用程序推送到带有硒的Appium中并从同一屏幕启动 [英] How to push app in background and launch from same screen in Appium with selenium

查看:67
本文介绍了如何在后台将应用程序推送到带有硒的Appium中并从同一屏幕启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用Appium和android驱动程序的android Automation中,有什么方法可以执行以下过程吗?

Is there any way to do the following process in android Automation using Appium with android driver?

在某些特定屏幕上按主页按钮. 将应用程序置于后台. 在一定时间间隔后,从同一屏幕打开应用程序.

Press home button from some specific screen. Put app in background. Open the app from same screen after some time interval.

如果有人知道,请帮助.

Please help if anybody knows.

推荐答案

  • 尝试着重于您当前的活动:

    • Try to focus on the current activity you were in :

      (AppiumDriver)driver.runAppInBackground(10); (AppiumDriver)driver.currentActivity();

      (AppiumDriver)driver.runAppInBackground(10); (AppiumDriver)driver.currentActivity();

      • 尝试开始与您以前相同的活动:

      • Try to start the same activity you were in :

      (AppiumDriver)driver.runAppInBackground(10);
      (AppiumDriver)driver.startActivity("appPackage","com.example.android.apis", null, null);

      (AppiumDriver)driver.runAppInBackground(10);
      (AppiumDriver)driver.startActivity("appPackage","com.example.android.apis", null, null);

      这篇关于如何在后台将应用程序推送到带有硒的Appium中并从同一屏幕启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆