WEditor

安装

github项目地址

https://github.com/openatx/weditor

安装代码

pip install --pre --upgrade weditor

显示如下,则安装成功

C:\Users\Administrator.PC-20170907TLUD>pip install --pre --upgrade weditor
Collecting weditorDownloading https://files.pythonhosted.org/packages/90/8b/f886be1af89c3444d688a1edf843b99532be72d6800ef6f2bbcc9c65ff77/weditor-0.0.4.dev9.tar.gz (1.2MB)100% |████████████████████████████████| 1.2MB 976kB/s
Collecting tornado>=4.3 (from weditor)Downloading https://files.pythonhosted.org/packages/e1/17/83cecc0ff2f200d9b7160e67726b2f419c53453bbe22929582fb08fe9122/tornado-5.1b1.tar.gz (516kB)100% |████████████████████████████████| 522kB 2.0MB/sRequested tornado>=4.3 from https://files.pythonhosted.org/packages/e1/17/83cecc0ff2f200d9b7160e67726b2f419c53453bbe22929582fb08fe9122/tornado-5.1b1.tar.gz#sha256=b640a110c98dfea03554120463bd4cd675f3245f15111c8893773620c03db15f (from weditor), but installing version 4.5.2
Collecting futures>=3.0.5 (from weditor)Downloading https://files.pythonhosted.org/packages/cc/26/b61e3a4eb50653e8a7339d84eeaa46d1e93b92951978873c220ae64d0733/futures-3.1.1.tar.gz
Requirement already up-to-date: six in c:\users\administrator.pc-20170907tlud\appdata\local\programs\python\python35\lib\site-packages (from weditor)
Collecting pillow (from weditor)Downloading https://files.pythonhosted.org/packages/ab/d2/d27a21bd3e64db1ca1dc7dc16026a16d77f5c3ffca9ec619eddeea7c47ce/Pillow-5.1.0-cp35-cp35m-win_amd64.whl (1.6MB)100% |████████████████████████████████| 1.6MB 747kB/s
Building wheels for collected packages: weditor, tornado, futuresRunning setup.py bdist_wheel for weditor ... doneStored in directory: C:\Users\Administrator.PC-20170907TLUD\AppData\Local\pip\Cache\wheels\43\29\78\ab5d01cff3bb4b396ec21f9c7b18b8c4448349bffa94d50137Running setup.py bdist_wheel for tornado ... doneStored in directory: C:\Users\Administrator.PC-20170907TLUD\AppData\Local\pip\Cache\wheels\66\c9\52\2cfc6fe979b8a3378aecfccea025b5f2303ad1ddd12846d57cRunning setup.py bdist_wheel for futures ... doneStored in directory: C:\Users\Administrator.PC-20170907TLUD\AppData\Local\pip\Cache\wheels\f3\f9\c7\4fbf1faa6038faf183f6e3ea61f17a5f7eea5ab9a1dd7753fd
Successfully built weditor tornado futures
Installing collected packages: tornado, futures, pillow, weditorFound existing installation: tornado 4.5.2Uninstalling tornado-4.5.2:Successfully uninstalled tornado-4.5.2Found existing installation: Pillow 4.3.0Uninstalling Pillow-4.3.0:Successfully uninstalled Pillow-4.3.0
Successfully installed futures-3.1.1 pillow-5.1.0 tornado-5.1b1 weditor-0.0.4.dev9
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

运行如下代码

python -m weditor

则跳出浏览器,查看手机view

可以点击reload按钮更新查看的页面

WIFI网络链接可以直接输入设备IP(192.168.31.234),点击Connect按钮。

import uiautomator2 as u2
from time import sleepd = u2.connect('192.168.31.234')# 启动App
d.app_start("com.meizu.mzbbs")# 搜索
d(resourceId="com.meizu.mzbbs:id/j0").click()# 输入关键字
d(resourceId="com.meizu.mzbbs:id/p9").set_text("flyme")# 搜索按钮
d(resourceId="com.meizu.mzbbs:id/tp").click()sleep(2)# 停止app
d.app_stop("com.meizu.mzbbs")

app_start()和app_stop()用于启动和停止应用。

常用的定位方式:

ResourceId定位:

d(resourceId="com.meizu.mzbbs:id/tp").click()

Text定位:

d(text="精选").click()

Description定位:

d(description="..").click()

ClassName定位:

d(className="android.widget.TextView").click()

1_weditor定位元素位置相关推荐

  1. APP自动化测试定位元素位置

    一,ID定位方法 如下图所示,使用uiautomator2 工具定位7的位置,只需要获取此位置的resource_id 信息即可 如果有resource-id属性就取resource-id值,有id属 ...

  2. appium通过坐标定位元素

    用appium做自动化时发现,有一些元素无法通过uiautomatorviewer进行定位,比如h5页面元素或者有的app元素在uiautomatorviewer中的属性没有唯一标识,这种情况下就只能 ...

  3. [607]appium根据屏幕大小滑动界面|通过坐标定位元素

    文章目录 appium根据屏幕大小滑动界面 通过坐标定位元素 appium根据屏幕大小滑动界面 driver.get_window_size() 获取屏幕的宽.高: driver.swipe() 从坐 ...

  4. python+webdriver学习鼠标键盘事件以及定位元素

    设置浏览器大小:像素点 set_window_size(width,height) maximize_window() 浏览器全屏显示,不带参数 控制浏览器前进.后退: driver.forward( ...

  5. 相对定位android,appium相对位置定位元素----父节点/兄弟节点定位

    appium相对位置定位元素----父节点/兄弟节点定位 发布时间:2020-06-30 05:51:41 来源:51CTO 阅读:5620 作者:niedongri 讲一下定位手机app上元素时定位 ...

  6. css审查元素一直有一块html,css父元素定位后子元素审查元素位置错乱

    父元素position:fixed写了一个遮罩层,里面的子元素审查元素位置错乱,在超出这个元素的位置还能定位到这个元素 直播平台授权 .toolstip { position: fixed; left ...

  7. html 固定一条直线的位置,html-CSS位置:固定在定位元素内

    html-CSS位置:固定在定位元素内 我有一个定位的div,其内容可能太长,因此出现滚动条(已设置overflow:auto). 它充当ajax应用程序中的对话框. 我想在其右上角修复一个关闭按钮, ...

  8. selenium点击元素位置_Selenium常见元素定位方法和操作

    一. 定位元素方法 官网地址:http://selenium-python.readthedocs.org/locating-elements.html        这里有各种策略用于定位网页中的元 ...

  9. 对比四种爬虫定位元素方法,你更爱哪个?

    作者 | 陈熹 来源 | 早起Python 头图 | 下载于视觉中国 在使用Python本爬虫采集数据时,一个很重要的操作就是如何从请求到的网页中提取数据,而正确定位想要的数据又是第一步操作.本文将对 ...

最新文章

  1. 坦克大战java_java版坦克大战游戏源码
  2. 数学建模学习笔记——蒙特卡洛模拟
  3. error: a label can only be part of a statement and a declaration is not a statement
  4. 【数据结构与算法】之深入解析“石子游戏IV”的求解思路与算法示例
  5. c#中textbox属性_C#.Net中的TextBox.Visible属性与示例
  6. Python python 五种数据类型--字符串
  7. Eygle力荐:Oracle 19c升级文档、视频、问答集锦
  8. vim-python j教程_实践Vim配置python开发环境
  9. 【转载】100多个很有用的JavaScript函数以及基础写法大集合
  10. 一行一行分析JQ源码学习笔记-03
  11. R与Python或协同助力机器学习:听Azure ML Studio讲座有感
  12. 五大好用的开源MySQL管理工具
  13. Mac和PC在工作中管理的对比(1)
  14. C# 中取绝对值的函数
  15. GIT、小乌龟、语言包下载
  16. 富龙飞联手文创产业研究所,推出国内首个AR+文创建设应用系统
  17. 【Love2d从青铜到王者】第十五篇:Love2d之角度和距离(Angles and distance)
  18. python合并相同内容单元格_实例28_在Excel表格中将上下行相同内容的单元格自动合并...
  19. 一次用Python制作电影字幕的尝试
  20. Three.js《踩坑日记1》

热门文章

  1. FileInputStream 读取文件内容
  2. Java中从字符串删除指定字符
  3. RMXP脚本解析(十五):Game_Battler(分割定义三)
  4. 5个免费的跨境电商营销工具,你Get了吗?
  5. Shiro RememberMe
  6. SSM框架整合+配置
  7. arduino按键控制LED 灯(按一下切换一次状态)
  8. 心之力带来种种不可思议的现象
  9. java SQL查询语句
  10. mysql delayed_Mysql:Delayed Replication:延迟复制