Comments (8)
目前还没有这种组合,下一个大版本会加上MotionEvent
. 到时就可以自定义手势了
from airtest.
好的 谢谢!
from airtest.
@NateRiverNaz 你好,目前版本已经提供了MotionEvent,可以自己拼装任意操作
https://github.com/AirtestProject/Airtest/blob/master/playground/android_motionevents.py
from airtest.
@Meteorix
你好, 根据您的写了例子改了一下,变成简单的按住并拖拽指定位置的图标到指定位置的实验
from airtest.core.api import *
from airtest.core.android.minitouch import *
connect_device("Android:///")
swipe_event = [DownEvent((500, 500)), SleepEvent(1),MoveEvent((0, 0)),UpEvent(0)]
device().minitouch.perform(swipe_event)
我的问题是:
1.具体DownEvent, SleepEvent,MoveEvent 的相关API文档,我想要实现比如传入name,TextMatches 之类的.
2.哪些event可以组合成motionevent?
2.完成图标的按住并拖拽后,手机坐标还是处于图标位置调整的状态,需要按home键。这种需要触发系统事件的,应该怎么调用?
thanks in advanced!!
from airtest.
- 暂时还没写MotionEvent的文档,直接看看代码把,很简单的。Poco与MotionEvent的集成可能要稍等 @adolli 会更新
- 同样,看看代码
Airtest/airtest/core/android/minitouch.py
Line 456 in edf9039
- 直接
home()
,这些主要的API可以看API文档
from airtest.
如果使用poco的话,可以用以下简单写法,实现将一个图标拖拽到另一个图标上面
telephone = poco(text='电话')
folder = poco(text='文件夹')
telephone.start_gesture().hold(1).to(folder).hold(1).up() # 最后面的up别忘了,hold时长根据实际情况调节
from airtest.
@Meteorix
同请问长按并拖动至指定位置的操作。
请问MotionEvent的文档写了吗~?
from airtest.
@IcyW
可以参考这个文档以及仓库里的playground里的相关代码:
http://airtest.netease.com/docs/cn/9_faq/3_api_faq.html#id15
from airtest.
Related Issues (20)
- window7 airtest 脚本编辑器窗黑屏 HOT 2
- 请问如何开启cuda加速
- [功能增强,不是bug] 关于支持app内webview的操作和录制 HOT 2
- 在Android V(Android 15)的手机上运行airtest进行UI测试,log中有yosemite 报错
- 安卓13(小米居多)总是报是否允许xxx访问所有设备日志,如何关闭? HOT 1
- Airtest怎么连接一个设备里面的多个屏幕中的一个呢?
- 获取剪贴板信息失败
- auto_setup使用window平台连接时候只有win32 backend
- iOS17 使用AirtestIDE可以连接设备,airtest run 无法连接设备
- connect_device说明示例错误,通过窗口名称匹配连接,不用单引号
- 元素的visible属性为false时,如何使用poco进行定位并操作
- Airtest图像识别能力可以移植到其他框架上吗? HOT 1
- 支持iOS 17 HOT 2
- 纯py脚本执行,偶现touch执行后,没有在模拟器进行点击操作,也没有报错 HOT 1
- 不知道怎么用airtestide启动windows软件,除了touch识别图片点击 HOT 1
- Airtest IDE目前是否支持Ubuntu 18.04和更高的Ubuntu版本
- win下使用exists匹配图像的时候,总是会把分辨率转换成(1024,0),导致识别不到
- 每个airtest和poco步骤,可以设置before hook & after hook吗?
- 报这个错误,使用 connect_device("windows:///?title_re='.*xxxx.*'") pywinauto.findwindows.ElementNotFoundError: {'title_re': "'.*xxxx.*'", 'backend': 'win32', 'visible_only': False}
- 连接设备后调用disconnect方法后依然可以对设备进行操作
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from airtest.