当前位置:网站首页>学习笔记 | uiautomation(如何)实现自动化
学习笔记 | uiautomation(如何)实现自动化
2022-08-03 23:22:00 【等君等你】
推荐python的一款神奇库——uiautomation
光看名字就应该能理解是UI+自动化
selenium是针对于浏览器,那么uiautomation就更厉害了,直接针对应用程序的UI元素。
话不多说,上干货。
老规矩,第一步安装,第零步pip list看下是不是已经安装过了
pip install uiautomation
然后我会和其他的博主一样无聊的介绍常用的类型元素、定位属性、操作?
这些知识满大街随处可见,问题就是授人以鱼不如授人以渔,教了钓鱼的技巧,结果没有鱼竿?
automation.py
如何定位到应用程序的UI元素,这个才是重中之重。
1. 命令行输出automation.py,不出意外的话会弹出一个py文件

2.运行这个py文件,在3秒内让鼠标点到想要知道的应用程序上,这不就出来了一堆的信息吗?

该windowControl,就写windowControl,该属性用classname就classname,但是一定注意尽可能保持单一性,避免一个操作对两个UI元素生效。
3.该写代码控制他们了。例如下面代码uiautomation.类型元素(属性).操作,最好导入库的时候import uiautomation as auto。
uiautomation.ButtonControl(ClassName="CCPushButton", SubName="是").Click()
鱼竿给你了,剩下的自己钓鱼吧!
边栏推荐
- 一个函数有多少种调用方式?
- 静态文件快速建站
- Testng listener
- 【深度学习】基于tensorflow的服装图像分类训练(数据集:Fashion-MNIST)
- The Chinese Valentine's Day event is romantically launched, don't let the Internet slow down and miss the dark time
- Embedded Systems: Clocks
- Analysys Analysis: The transaction scale of China's online retail B2C market in Q2 2022 will reach 2,344.47 billion yuan
- Network basic learning series four (network layer, data link layer and some other important protocols or technologies)
- Work Subtotal QT Packing
- 完全二叉树问题
猜你喜欢

用队列模拟实现栈

Fluorescein-PEG-CLS, cholesterol-polyethylene glycol-fluorescein scientific research reagent

override learning (parent and child)

CAS: 178744-28-0, mPEG-DSPE, DSPE-mPEG, methoxy-polyethylene glycol-phosphatidylethanolamine supply

Republish the lab report
![navicat 连接 mongodb 报错[13][Unauthorized] command listDatabases requires authentication](/img/09/a579c60e07cdc145175e72673409f7.png)
navicat 连接 mongodb 报错[13][Unauthorized] command listDatabases requires authentication

Redis persistence method

.NET6之MiniAPI(十四):跨域CORS(上)

如何创建一个Web项目

MiniAPI of .NET6 (14): Cross-domain CORS (Part 1)
随机推荐
RPA power business automation super order!
utils timer
直播预告 | 构建业务智联,快速拥抱财务数字化转型
Testng listener
用两个栈模拟队列
[Paper Reading] TRO 2021: Fail-Safe Motion Planning for Online Verification of Autonomous Vehicles Using Conve
[2022强网杯] polydiv和gamemaster
Creo9.0 绘制中心线
2022/8/3 Exam Summary
Quickly build a website with static files
AOSP CameraLatencyHistogram的原理与使用
Create function report error, prompting DECLARE definition syntax problem
The salary of soft testers at each stage, come to Kangkang, how much can you get?
射频芯片ATE测试从入门到放弃之参数测试
V8中的快慢数组(附源码、图文更易理解)
【LeetCode】最长公共子序列(动态规划)
Analysys Analysis: The transaction scale of China's online retail B2C market in Q2 2022 will reach 2,344.47 billion yuan
curl使用指南
如何创建一个Web项目
RPA助力商超订单自动化!