poco常用API

编程入门 行业动态 更新时间:2024-10-08 14:43:08

poco<a href=https://www.elefans.com/category/jswz/34/1769776.html style=常用API"/>

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等待

更多推荐

poco常用API

本文发布于:2024-03-09 23:49:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1726472.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:常用   poco   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!