永发信息网

appium中background app关键字怎么用

答案:1  悬赏:60  手机版
解决时间 2021-11-16 19:31
  • 提问者网友:你挡着我发光了
  • 2021-11-16 07:23
appium中background app关键字怎么用
最佳答案
  • 五星知识达人网友:往事隔山水
  • 2021-11-16 08:19
首先看下background_app的定义,我拿python来举例:

webdriver中是这么定义的,就是把应用置于后台一段时间,

def background_app(self, seconds):
    """Puts the application in the background on the device for a certain
    duration.

    :Args:
     - seconds - the duration for the application to remain in the background
    """
    data = {
        'seconds': seconds,
    }
    self.execute(Command.BACKGROUND, data)
    return self在实际的应用中,把时间作为参数传进来
self.driver.background_app('10')这样app就会被置于后台10秒钟,之后再唤起到前台
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯