Script 1.8.1
- 脚本语言
- 设备对象获取
- Device.getMain
- Device.searchObject(<DeviceName>)
- Device.searchObject(sigmaConst.DevAll)
- Device.searchObject(sigmaConst.DevGroup, <GroupName>)
- Device.searchObject(sigmaConst.DevSerial,<Serial>)
- Device.searchObject(sigmaConst.DevSelectOne)
- Device.searchObject(sigmaConst.DevSelectMult)
- Device.searchObject(sigmaConst.DevSelectGroup)
- 设备属性值
- 设备控制接口说明
- 公共接口说明
- 快捷键定义接口
- MTE说明
- getPixelColor
- getPixelColorStr
- runCTest
- runDTest
- setMessage(对象成员函数)
- setMessage(非对象成员函数)
- setStatus(对象成员函数)
- setStatus(非对象成员函数)
- stop(对象成员函数)
- Testrun(对象成员函数)
- Color
- setName
- Coord
- ImageInfo
- define
- lastError
- readExcel
- scriptKill
- scriptKillAll
- scriptList
- getLanguage
- scriptRun
- sigmaLoad
- screenshot
- seekColor
- seekImage
- seekImageByID
- send
- sendMessage
- setName
- setVolumes
- shift
- runApp
- swipe(coordArray)
- upload(fpath,tpath,timeout)
- unlock
- sleep()
- uninstallAPK(packageName)
- wakeup()
- deleteListener
- getNotification
- Notification
- reset
- swipe
- uninstallAPK
- unlock
- upload
- uploadTessData
- wakeup
- writeFile
- sleep
- click(x,y)
- closeApp(packageName)
- download(fpath,tpath,timeout)
- inputText(text)
- installAPK(apkPath)
- lock(timeout)
- runApp(packageName)
- screenShot(path,imageType,tx,ty,bx,by)
- send(key)
- exit
- execCommand
- execCommand
- fileBinaryReader
- fileTextReader
- delay
- getSDPath
- getSetting
- getTextByBaiduCloudOnAndroid
- setVolumes(type,volume)
- shift(type)
- sendMessage(phone,message)
swipe
原型:
swipe(coord)
是否支持多设备:
支持
对应的 REST API:
描述:
模拟用户操作的触控事件,可以实现单点或者多点操作的滑动事件。
坐标格式:在数组中的第一个坐标组为按下坐标;在数组中的最后一个坐标组为弹起坐标;中间数组为滑动坐标。
参数:
coord: 数组坐标点。参数示例如下:
单点坐标格式定义:[ x 坐标,y 坐标,延迟执行时间]
多点坐标格式定义:[ x1 坐标,y1 坐标,x2 坐标,y2 坐标,延迟执行时间]
1. 单点滑动:[[124,256,123],[356,156,111],[212,222,222],[256,456,333]]
2. 多点滑动:[[124,256,212,121,123],[256,456,323,423,333],[256,456,323,423,333]]
返回值:
整型:成功返回 0,失败返回非 0,此时可通过 lastError() 函数获取具体的错误信息。
示例:
//获取当前主控设备对象 var device = Device.getMain(); 【单点模式】 //从坐标点 (124,256) 滑动到 (324,356) device.swipe ([[124,256,30],[224,296,100],[324,356,1]]); 【两点模式】 //从坐标点 (124,256,255,296) 滑动到 (324,356,435,567) device.swipe([[124,256,255,296,30],[224,296,340,432,100],[324,356 ,435, 567,1]]);