哪位大神知道怎么用appium实现引导页的滑动,并且成功跳转到主界面?
2个回答
展开全部
通过获取屏幕的尺寸大小,然后通过swipe进行滑动,具体代码如下:
from appium import webdriver
from time import sleep
capabilites = {
"platformName": "Android",
"platformVersion": "5.1.1",
"deviceName": "aa19503",
"app": "F:\\mukewang.apk",
}
driver = webdriver.Remote('
# 获取屏幕宽和高
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
x = get_size()[0] / 10
sleep(3)
driver.swipe(x1, y1, x, y1)
swipe_left()
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询