首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

Appium自动化测试课程笔记之五

滑动屏幕

模拟用户滑动屏幕的操作。

# python

driver.swipe(start_x=75, start_y=500, end_x=75, end_y=0, duration=800)

捏(Pinch)手势

在屏幕上使用捏(Pinch)手势。

# python

driver.pinch(element=el)

放大屏幕(Zoom)

在屏幕上使用放大手势。

# python

driver.zoom(element=el)

滚动到

滚动到指定的元素。

# python

driver.execute_script("mobile: scroll", {"direction": "down", "element": element.id})

拉取(pull)文件

从设备上拉取文件。

# python

driver.pull_file('Library/AddressBook/AddressBook.sqlitedb')

推送(push)文件

推送文件到设备。

# python

data = "some data for the file"

path = "/data/local/tmp/file.txt"

driver.push_file(path, data.encode('base64'))

  • 发表于:
  • 原文链接https://kuaibao.qq.com/s/20190122A0L5F600?refer=cp_1026
  • 腾讯「腾讯云开发者社区」是腾讯内容开放平台帐号(企鹅号)传播渠道之一,根据《腾讯内容开放平台服务协议》转载发布内容。
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券