def tap_location(data_set):
''' Tap the provided position using x,y cooridnates '''
# positions: list containing x,y coordinates
sModuleInfo = inspect.stack()[0][3] + " : " + inspect.getmoduleinfo(__file__).name
CommonUtil.ExecLog(sModuleInfo,"Function Start", 0)
# Parse data set
try:
positions = []
posX, posY = data_set[0][2].replace(' ','').split(',')
positions.append((posX, posY)) # Put coordinates in a tuple inside of a list - must be this way for appium_driver.tap
except Exception:
errMsg = "Unable to parse data set"
return CommonUtil.Exception_Handler(sys.exc_info(),None,errMsg)
try:
appium_driver.tap(positions) # Tap the location (must be in list format)
CommonUtil.ExecLog(sModuleInfo,"Tapped on location successfully", 0)
return 'passed'
except Exception:
errMsg = "Tapped on location unsuccessfully"
return CommonUtil.Exception_Handler(sys.exc_info(),None,errMsg)
BuiltInFunctions.py 文件源码
python
阅读 42
收藏 0
点赞 0
评论 0
评论列表
文章目录