BuiltInFunctions.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:Zeuz_Python_Node 作者: AutomationSolutionz 项目源码 文件源码
def Swipe(x_start, y_start, x_end, y_end, duration = 1000, adb = False):
    ''' Perform single swipe gesture with provided start and end positions '''
    # duration in mS - how long the gesture should take

    sModuleInfo = inspect.stack()[0][3] + " : " + inspect.getmoduleinfo(__file__).name
    CommonUtil.ExecLog(sModuleInfo,"Function Start", 0)

    try:
        CommonUtil.ExecLog(sModuleInfo, "Starting to swipe the screen...", 0)
        if adb:
            CommonUtil.ExecLog(sModuleInfo, "Using ADB swipe method", 0)
            adbOptions.swipe_android(x_start, y_start, x_end, y_end, duration, device_serial) # Use adb if specifically asked for it
        else:
            appium_driver.swipe(x_start, y_start, x_end, y_end, duration) # Use Appium to swipe by default

        CommonUtil.TakeScreenShot(sModuleInfo) # Capture screenshot, if settings allow for it
        return "passed"
    except Exception:
        errMsg = "Unable to swipe."
        return CommonUtil.Exception_Handler(sys.exc_info(),None,errMsg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号