我在我们的自动化框架中使用了appium-android和watir-cucumber的组合。
在移动模拟器中,我在chrome浏览器中打开了一个站点。
我想做一个滑块图像的水平滑动。
如果有人知道如何从左向右滑动图像,或者相反,请让我知道。
我已经尝试了Appium的触摸动作,但到目前为止还没有成功。
发布于 2017-12-05 18:17:51
@Manmohan_singh答案可能有效,但swipe方法是弃用的...所以你应该使用TouchScreen
Python代码
screenSize = driver.get_window_size()
screenWidth = screenSize['width']
screenHeight = screenSize['height']
touchAction = TouchAction(driver)
#Move slider from left to right (finger movement simulation goes from right to left)
touchAction.press(None, screenWidth - (screenWidth/3), y).wait(500).move_to(None, (screenWidth/3), 0).release().perform()希望它能起作用
发布于 2017-12-05 18:23:39
查看https://github.com/Ricardonacif/touch_action触摸屏操作是您应该使用的滑动操作
https://stackoverflow.com/questions/47647946
复制相似问题