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)
- 代码执行过程中停止了,添加了异常捕获,没有捕获到任何错误也不报错,最后一个日志输出是[13:58:21][DEBUG]<airtest.utils.nbsp> [airtouch_server]b'Start local socket (maxpresent_14426) server...' HOT 1
- android 启动一个线程实时监控adb logcat 输出,但是无法一直执行,执行不到1S就会被暂停,导致程序一直卡住,无法继续
- ios 使用远程地址跑时间长了很多点击不生效,同时手机变得卡,重新拔插手机之后又正常了
- 使用360急速谷歌内核,调用 driver.airtest_test方法图片识别成功后,点击的位置偏下
- 哪里可以看到maxtouch的源码?
- try_log_screen与snapshot() HOT 1
- 如何获取Path from root node,以及如何通过此path定位控件。
- 开启IDE情况下,命令行执行时获取的adb进程路径有时候空的 HOT 1
- 连接鸿蒙设备
- android 设备 跑完用例时 断开设备卡住了 HOT 1
- VIVO手机截屏错误,屏幕翻转错误
- 执行完double_click()之后在报告里没有那个点击后的红圈显示
- 运行脚本启动Chrome闪退,Chrome 121.0.6167.140
- 在安卓真机上执行 keyevent( "volumeUp" ) 或 keyevent( "volumeDown" ) 无效
- airtest是否引用了psutil
- 建议移除psutil
- airtest link will automatically disconnect after working for a period of time. How to solve this problem HOT 1
- 安装完最新的appium的wda,airtest无法连接IOS HOT 1
- poco服务启动慢 HOT 2
- 如果想利用AI 配合 airtest框架实现 自动编写UI测试用例 请教下有思路吗?
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.