框架:Robotfactory
工具:Appium
语言:Python
支持版本:AppiumLibrary 1.4.5
1、获取设备屏幕宽度和高度
${screenwidth} Get Window Width
${screenheight} Get Window Height
注意,这个函数AppiumLibrary 1.4.5及版本以上支持。
2、指定像素滑动屏幕
swipe 360 1100 360 600 3000
3、示例代码
${screenwidth} Get Window Width
${screenheight} Get Window Height
${x} Evaluate ${screenwidth}*${0.5}
${y} Evaluate ${screenheight}*${0.5}
${s} Evaluate ${screenheight}*${0.8}
swipe ${x} ${s} ${x} ${y} 3000