自动化--APP UI自动化--Airtest 实用命令汇总

1. 打印定位的文本

1 #先定位到该元素(精确定位、模糊定位都可以)
2 textName=poco(textMatches="^我的任务.*$") 
3 
4 #使用get_text() 拿到想要的定位的文本
5 realName = textName.get_text()

2.启动app

如图,获取该app包名

1 start_app('w2xxxxxxxxxro')

3.关闭app

2中获取app包名

1 stop_app('w2xxxxxxxxxxxro')

4.输入框输入值

1 poco(name="xxxx").set_text("111")
原文地址:https://www.cnblogs.com/whycai/p/14076411.html