三种方法
通过坐标滑动
driver.swipe(498,1470,482,498,5000)#swipe方法适用坐标滑动
通过元素定位滑动
有惯性
调用driver.scroll()
button_1=driver.find_element(by=AppiumBy.XPATH,value="//*[@text='Fruit']")
button_2=driver.find_element(by=AppiumBy.XPATH,value="//*[@text='Planting information']")
driver.scroll(button_1,button_2)#通过元素定位滑动(有惯性)
没有惯性
调用driver.drag_and_drop()
button_1=driver.find_element(by=AppiumBy.XPATH,value="//*[@text='Fruit']")
button_2=driver.find_element(by=AppiumBy.XPATH,value="//*[@text='Planting information']")
driver.drag_and_drop(button_2,button_1)#通过元素定位滑动(没有惯性)