ATX ATX 录放编辑器 -- WEditor

codeskyblue · 2017年03月15日 · 最后由 qugo9955 回复于 2020年10月16日 · 13094 次阅读

说明

编辑器是最近才写出来的,虽然可能还有不完善的地方,但是焦躁的内心已经迫不及待的将它放出来了。本打算起名叫 Web Editor 的,为了能少打几个字母,于是简化成了 WEditor。

现在的 WEditor 可以实现,操作的同时生成测试代码。开发效率相当的高,有时看的连我自己都感动了。

效果演示

问答

浏览器的支持情况

最好用 Chrome,目前发现 Edge,Safari 都不好使

是否也支持 iOS?

是的,除了 Android,iOS 也是支持的

为什么感觉跟 Appium-Desktop 的设计这么像呢?

当然了,Appium-Desktop 参考了我的设计(备注:请反过来读)

是否打算支持 Appium 的脚本

不打算支持,我最近的开发都是本着平常用不到就不开发的原则。我平时不用 Appium,所以出了问题也不会维护,不如直接点不开发了。

怎么安装和使用?

去这个网站看安装教程 https://github.com/openatx/weditor
同时记得安装 ATX https://github.com/NetEaseGame/AutomatorX

支持游戏测试吗?

暂时不支持,但是以后我会加上去的

Tap 无响应

关闭代理试试好使不

我还想问 @#¥-&*&%¥

如果还有问题,记得留言

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 71 条回复 时间 点赞

支持。atx 很棒。

要的就是这个态度,国内测试工具开发者要牛气,准备做国际化不?

恒温 回复

目前都是全英文的

恒温 回复

文档看这个项目的关注度,比较高的话,就会做国际化

#5 楼 @codeskyblue ATX 用的人多吗?

—— 来自 TesterHome 官方 安卓客户端

山姆大叔 回复

github 297 个 star 马马虎虎吧

安装完成后启动 提示 local server is not start ,麻烦问一下这个要起哪个 server?我用的是 ios 设备,webdriveragent 已经起动了。,请大神帮忙解答

比较期待支持游戏版~

于学飞 回复

控制台的错误提示截下图,或者加 QQ 群聊 497460177

第 300 个 star,期待游戏版本,现在项目已经在用 ATX 做基本功能模块的冒烟了,效果现在看来还 OK

支持 py3 么?

dadeshuo 回复

支持了

是否可以分享个实践文章啦

666,棒,学习~

codeskyblue [atx 系列] android 脚本录制 中提及了此贴 03月20日 10:06

小白,python -m weditor 之后打开了浏览器,显示百度首页,之后没反应了,该怎么操作啊?~~~

win 10 系统,完全卡死

统一回复:atx 更新到最新,然后卡死的情况,截个图看看 @lvph339 @lp276507556

codeskyblue 回复

我用的 ubuntu16.04,谷歌浏览器,设置的百度是首页。运行 python -m weditor 之后,和手动打开浏览器一个效果。打开的是百度,并没有到 WEditor 的页面

lvph339 回复

还真没有测试过在 ubuntu 上的兼容性,你手动打开 http://atx.open.netease.com 试试

codeskyblue 回复

先输入命令,在地址栏输入 http://atx.open.netease.com就好了,可能是和
ubuntu 兼容不好

lvph339 回复

你要说什么?

codeskyblue 回复

应该就是兼容性的问题,输入网址就好了

使用 新发现
使用 Weditor 时 还是别开 *** 国外 *** 不然 有些功能 会 失效

請問有像是 android 圖形鎖 的解決方法嗎

ok 回复

没研究过

codeskyblue ATX 资料快速索引 中提及了此贴 06月21日 19:39

你好 录制运行的时候报错

d = atx.connect()
d(text="登录/注册").click()
recv subprocess: 'Traceback (most recent call last):\n'
recv subprocess: ' File "", line 3, in \n'
recv subprocess: ' File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/atx/init.py", line 77, in connect\n'
recv subprocess: ' c = cls(connect_url, **kwargs)\n'
recv subprocess: ' File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/atx/drivers/android.py", line 87, in init\n'
recv subprocess: ' self._adb_device = self._adb_client.device(serialno)\n'
recv subprocess: ' File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/atx/adbkit/client.py", line 130, in device\n'
recv subprocess: ' raise EnvironmentError("Device(%s) not attached." % serial)\n'
recv subprocess: 'EnvironmentError: Device(default) not attached.\n'
Websocket closed

按照报错的字面意思说我没连上设备 但是我已经可以在网页上看到设备监控了 也可以自动输出代码 就是无法 run 来执行 一执行就报错

帝恨牧 回复

明天修复下

HTTPConnectionPool(host='localhost', port=8100): Max retries exceeded with url: /screenshot (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused',))

ios 连接一直被拒绝

梦梦GO 回复

先确认下 wda 是不是好的

codeskyblue 回复

我的 wda 是之前写 appium 时候装的,app-inspector -u ***** --verbose 可以启动
重新安装 wda 之后,浏览器访问可以 localhost:8100/status 可以获取 json 字符串

python -m weditor 命令行打开 报错如图

之前是因为没有进行端口转发 iproxy 8100 8100 所以报了下面这个错误
HTTPConnectionPool(host='localhost', port=8100): Max retries exceeded with url: /screenshot (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused',))

执行这个命令端口转发之后,就如上一层回复截图
Error
cannot write mode RGBA as JPEG

server:
SN http://localhost:8100
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/weditor/main.py", line 108, in get
d.screenshot().save(buffer, format='JPEG')
File "/Library/Python/2.7/site-packages/PIL/Image.py", line 1893, in save
save_handler(self, fp, filename)
File "/Library/Python/2.7/site-packages/PIL/JpegImagePlugin.py", line 604, in _save
raise IOError("cannot write mode %s as JPEG" % im.mode)
IOError: cannot write mode RGBA as JPEG
[W 170912 11:44:22 web:2063] 430 GET /api/v1/devices/http%3A%2F%2Flocalhost%3A8100/screenshot (::1) 338.68ms

梦梦GO 回复

升级下 weditor 就好了,旧版的问题

老马 ubuntu16.04 ATX 使用记录 中提及了此贴 01月25日 17:23
梦梦GO 回复

解决了吗?我报跟你一样的问题,弄来弄去还是没解决😭

安卓手机,连接时老是报错,求助!!!

C:\Users\Administrator>python -m weditor
listen port 17310
[I 180209 11:13:51 web:2087] 304 GET /api/v1/version (::1) 1.00ms
[I 180209 11:13:57 web:2087] 200 POST /api/v1/connect (::1) 167.00ms
SN ae95d684-4eb1-40b5-a099-282d7cb6924b
W 180209 11:13:59 api:40), retrying i
n 0.5 seconds...
W 180209 11:13:59 api:40), retrying i
n 0.6 seconds...
W 180209 11:14:00 api:40), retrying i
n 0.7 seconds...
W 180209 11:14:01 api:40), retrying i
n 0.8 seconds...
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\weditor_main_.py", line 134, in get
d.screenshot().convert("RGB").save(buffer, format='JPEG')
File "", line 2, in screenshot
File "C:\Python27\lib\site-packages\retry\api.py", line 74, in retry_decorator

logger)
File "C:\Python27\lib\site-packages\retry\api.py", line 33, in retry_interna
l
return f()
File "C:\Python27\lib\site-packages\uiautomator2__init
.py", line 1006, in s
creenshot
r = requests.get(self.server.screenshot_uri, timeout=10)
File "C:\Python27\lib\site-packages\requests\api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "C:\Python27\lib\site-packages\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 508, in reques
t
resp = self.send(prep, **send_kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "C:\Python27\lib\site-packages\requests\adapters.py", line 490, in send
raise ConnectionError(err, request=request)
ConnectionError: ('Connection aborted.', error(10054, ''))
[W 180209 11:14:02 web:2087] 430 GET /api/v1/devices/ae95d684-4eb1-40b5-a099-282
d7cb6924b/screenshot (::1) 2675.00ms

蔡瑞淳 回复

提供一下手机里的/sdcard/atx-agent.log


android 端连接不上这是什么原因呢 求大神支招

test 回复

同问 我也出现了这个问题 一直找不到原因

set_keys() 好像不灵了,我明明已经输入了,进行下一步的时候却提示没有输入,不知道什么原因

bellman 回复

可能是 app 的 bug 哎

codeskyblue 回复

可是手动就可以,用这个输入就不行😂

codeskyblue 回复

我用的是小米手机,其他的手机没试过,不知道是不是兼容性的问题

安卓手机:python -m weditor 时报错:
HTTPConnectionPool(host='localhost', port=8100): Max retries exceeded with url: /screenshot (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused',)) 一直未找到原因 请帮忙

补充下:我发现是 atx 打开后连接的 ip 与手机 ip 不一致导致的,手动改了下,就可以 reload app 的 ui 了,现在要想版本解决为啥到 atx 后 ip 地址不对

/ws/v1/build 接口是干嘛用的?

张帅 回复

运行测试代码的

您好 我的是 ubuntu 为啥打开之后一直转圈啊 啥都出不来啊!

HTTPConnectionPool(host='192.168.196.169', port=7912): Max retries exceeded with url: /screenshot/0 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 10061] ',))

报这个错误。


您好,这个报错不知道怎么搞了

pc 命令行里再执行一次:python -m uiautomator2 init
https://shop150751655.m.taobao.com

怎么让页面显示更多属性啊,我想了解 scrollable,focused,index,enabled,等更多信息,
修改了下源码,成功更改了我想显示的元素,多谢多谢

仅楼主可见

我使用 python -m weditor 命令打开后,点击 connect 为啥抱这个错误呀,求楼主解答。

我使用的是 python3.6 版本,

请教下楼主,我用 python -m weditor 默认打开了 ie 浏览器,但是啥都没有,我又手动打开了 google 浏览器输入网址,但是连接不上,求指导哇

大神,为什么坐标或者元素点击没有效果,这个元素用 Appium 是识别不到的,但是这个工具可以识别,但点击没有效果

wolfgao 移动客户端 /UI 开源测试框架梳理和大比拼 中提及了此贴 02月27日 21:03

点击 Connect 按钮时,提示 “Local server not started, start with”,楼主知道是为什么吗?求解答

[I 190813 16:01:48 web:2246] 304 GET / (::1) 19.20ms
[I 190813 16:02:00 web:2246] 304 GET /api/v1/version (::1) 0.49ms
[W 190813 16:02:02 connectionpool:662] Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))': /version
[W 190813 16:02:02 connectionpool:662] Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))': /version
[W 190813 16:02:02 connectionpool:662] Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))': /version
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/uiautomator2/init.py:164: RuntimeWarning: backend atx-agent is not alive, start again ...
RuntimeWarning)

执行的时候一直报这个错误,连不上 Android 手机

ouhehuang 回复

有解吗?

我的微信底部菜单点击无效,也没报错。tap 和 坐标点击都不行。

已解决:虽然我也不知道为啥好的。貌似是使用了 unicodeKeyboard 然后下面那部分被挡住了

testwangzheng 回复

安卓 9.0,水滴屏。。。获取到的屏幕尺寸不对

您好,这个现在可以支持找到 H5 的控件吗?

suzhenyu006 回复

还不行

使用 iOS 模拟器时,点击 connect 报错:
错误信息如下:
Traceback (most recent call last):
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connection.py", line 157, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection
raise err
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 1229, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 1275, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 1224, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 1016, in _send_output
self.send(msg)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 956, in send
self.connect()
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connection.py", line 184, in connect
conn = self._new_conn()
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connection.py", line 169, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8100): Max retries exceeded with url: /status (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/wda/init.py", line 70, in httpdo
response = requests.request(method, url, data=data, timeout=HTTP_TIMEOUT)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8100): Max retries exceeded with url: /status (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connection.py", line 157, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection
raise err
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 1229, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 1275, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 1224, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 1016, in _send_output
self.send(msg)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 956, in send
self.connect()
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connection.py", line 184, in connect
conn = self._new_conn()
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connection.py", line 169, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8100): Max retries exceeded with url: /status (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/luojilab/weditor/weditor/web/handlers/page.py", line 153, in post
id = connect_device(platform, device_url)
File "/Users/luojilab/weditor/weditor/web/device.py", line 103, in connect_device
d = AppleDevice(device_url)
File "/Users/luojilab/weditor/weditor/web/device.py", line 55, in __init
_
self.scale = c.session().scale
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/wda/
init_.py", line 252, in session
sid = self.status()['sessionId']
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/wda/
init.py", line 191, in status
res = self.http.get('status')
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/wda/
init.py", line 101, in fetch
return self._fetch_no_alert(method, url, data)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/wda/
init.py", line 107, in _fetch_no_alert
return httpdo(target_url, method, data)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/wda/
init_.py", line 75, in httpdo
response = requests.request(method, url, data=data, timeout=HTTP_TIMEOUT)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8100): Max retries exceeded with url: /status (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused'))

求大神指点

仅楼主可见
73楼 已删除


点击意向物业,下边弹出的这个弹出框,要怎么获取呢?WEditor 识别不到

qugo9955 回复

点击一下 dump hierarchy 试试呢

codeskyblue 回复

dump hierarchy 试了也不行,鼠标放进去,识别的是原来下面那层的元素

codeskyblue 回复

仔细看了下,弹出框这部分元素,在 Hierarchy 中没找到,应该是 Hierarchy 没获取到。不知道为什么 Hierarchy 获取不到他

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册