Appium的ios配置
automationName text XCUITest
platformName text iOS
platformVersion text 11.3
deviceName text iphone Simulator
app firepath 路径
-----------------------------------------------------------------------------------------------------
from appium import webdriver
import time
capability={
"automationName ": "XCUITest",
"platformName " : "iOS",
"platformVersion " : "11.3",
"noReset":"true",
"deviceName " : "iphone Simulator",
"app" :" 路径"
}
driver=webdriver.Remote('http://127.0.0.1/wd/hub',capability)
driver.switch_to.alert.accept()
-------------------------------------------------------------------------
from appium import webdriver
import time
capability={
"automationName ": "XCUITest",
"platformName " : "iOS",
"platformVersion " : "11.3",
"noReset":"true",
"deviceName " : "iphone Simulator",
"app" :" 路径"
}
driver=webdriver.Remote('http://127.0.0.1/wd/hub',capability)
driver.execute_script("mobile:scroll",{"direction":"right"})
def get_size():
size=driver.get_window_size()
width=size['width']
height=size['height']
return width,height
#向左滑动
def swipe_left():
x1=get_size()[0]/10*9
y1=get_size()[1]/2
x2=get_size()[0]/10
driver.swipe(x1,y1,x2,y1)
#向右滑动
def swipe_right():
x1=get_size()[0]/10
y1=get_size()[1]/2
x2=get_size()[0]/10*9
driver.swipe(x1,y1,x2,y1)
#向上滑动
def swipe_up():
x1=get_size()[0]/2
y=get_size()[1]/10*9
y1=get_size()[0]/10
driver.swipe(x1,y,x1,y1)
#向下滑动
def swipe_down():
x1=get_size()[0]/2
y=get_size()[1]/10
y1=get_size()[1]/10*9
driver.swipe(x1,y,x1,y1)
def swipe_on(direction):
if direction=='up':
swipe_up()
elif direction=='down':
swipe_down()
elif direction=='left':
swipe_left()
else:
swipe_right()
swipe_left()
driver.quit()
最新文章
- 让人一用钟情的VS插件系列之一——Web Essentials(Web开发必备利器)
- TortoiseSVN status cache占用CPU高
- Only top uni produces good ppt.
- 查询一个ID出现2种结果的情况
- 最简单的PHP socket echo server。
- OpenJudge 2792 集合加法
- Mysql访问权限问题:Access denied for user 'root'@'XXX' (using password: YES)
- 重新拾取:TFS2017钉钉机器人源代码签入通知
- 在windows下搭建汇编编程环境
- spring cloud中feign的使用
- 消息中间件:rabbitmq安装
- ubuntu下VS code如何调试C++代码
- centos服务重启
- BZOJ2337: [HNOI2011]XOR和路径(期望 高斯消元)
- No.1001_第六次团队会议
- php中heredoc的使用方法
- BZOJ 2131 圈地计划(最小割+黑白染色)
- 分布式跟踪系统zipkin+mysql
- 系统变量 %USERPROFILE%
- CQRS轻量级框架【CQRSlite】学习使用小记