poco常用API

poco框架

基本选择器(最常用):poco("btn_start",type="button")

相对选择器:poco("plays").child("playBasic").offspring("star_single")

  • 子节点:child
  • 所有子节点:children
  • 子孙节点:offspring
  • 父节点:parent
  • 兄弟节点:sibling

空间顺序选择器:利用索引顺序选中单个元素

name0 = poco("Content").child(type="Text")[0].get_name()
name1 = poco("Content").child(type="Text")[1].get_name()
name2 = poco("Content").child(type="Text")[2].get_name()

正则表达式

poco(textMatches="....")

poco(nameMatches="....")

点击操作click

单击:poco('start_single').click()

长按:poco('start_single').long_click()

滑动swipe

向下滑动0.2个单位:poco('Handle').swipe([0,0.2])

poco('Handle').swipe('down')  默认一个单位

向上滑动0.2个单位:poco('Handle').swipe([0,-0.2])

poco('Handle').swipe('up')

exsits()判断空间是否存在

if  poco('star_single').exists():
    poco('star_single').click
else:
    print('not found')

控件拖动drag_to

for star in poco('star'):
    star.drag_to(poco('shell'))
#或者drag_to里写坐标
    star.drag_to([0.52,0.51])

foucs 坐标偏移

wait等待

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值