当前位置:网站首页>学习笔记 | 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()
鱼竿给你了,剩下的自己钓鱼吧!
边栏推荐
- SRE运维解密-什么是SRE:DevOps模型的具体实践!
- 射频芯片(RFIC)的协议之5G及其调制
- The sword refers to the offer question 22 - the Kth node from the bottom in the linked list
- curl使用指南
- 获国际权威认可 | 云扩科技入选《RPA全球市场格局报告,Q3 2022》
- 二叉搜索树解决落叶问题
- Storage engine written by golang, based on b+ tree, mmap
- The Chinese Valentine's Day event is romantically launched, don't let the Internet slow down and miss the dark time
- 易观分析:2022年Q2中国网络零售B2C市场交易规模达23444.7亿元
- SolidEdge ST8安装教程
猜你喜欢
随机推荐
ts用法大全
log4j-slf4j-impl cannot be present with log4j-to-slf4j
响应式织梦模板除尘器类网站
最小化安装debian11
栈的压入、弹出序列
Recognized by International Authorities | Yunzhuang Technology was selected in "RPA Global Market Pattern Report, Q3 2022"
3D 语义分割——2DPASS
The sword refers to the offer question 22 - the Kth node from the bottom in the linked list
软测人每个阶段的薪资待遇,快来康康你能拿多少?
Work Subtotal QT Packing
Scala基础【正则表达式、框架式开发原则】
HCIP BGP lab report
First domestic open source framework 】 【 general cloud computing framework, any program can be made into cloud computing.
Fluorescein-PEG-CLS,胆固醇-聚乙二醇-荧光素科研试剂
直播系统聊天技术(八):vivo直播系统中IM消息模块的架构实践
Quickly build a website with static files
易观分析:2022年Q2中国网络零售B2C市场交易规模达23444.7亿元
2022/8/3 Exam Summary
OPC UA 与IEC61499 深度融合(1)
curl使用指南









