当前位置:网站首页>学习笔记 | 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()
鱼竿给你了,剩下的自己钓鱼吧!
边栏推荐
猜你喜欢
Pytest学习-setup/teardown
物联网新零售模式,引领购物新潮流
Fluorescein-PEG-CLS, cholesterol-polyethylene glycol-fluorescein scientific research reagent
Another MySQL masterpiece published by Glacier (send the book at the end of the article)!!
Embedded Systems: Clocks
ML's yellowbrick: A case of interpretability (threshold map) for LoR logistic regression model using yellowbrick based on whether Titanic was rescued or not based on the two-class prediction dataset
冰河又一MySQL力作出版(文末送书)!!
重发布实验报告
【论文阅读】TRO 2021: Fail-Safe Motion Planning for Online Verification of Autonomous Vehicles Using Conve
[Paper Reading] TRO 2021: Fail-Safe Motion Planning for Online Verification of Autonomous Vehicles Using Conve
随机推荐
First domestic open source framework 】 【 general cloud computing framework, any program can be made into cloud computing.
log4j-slf4j-impl cannot be present with log4j-to-slf4j
internship:编写excel表的上传方法(导入)
【RYU】rest_router.py源码解析
全球首款量产,获定点最多!这家AVP Tier1如何实现领跑?
举一个 web worker 的例子
The Chinese Valentine's Day event is romantically launched, don't let the Internet slow down and miss the dark time
AOSP CameraLatencyHistogram的原理与使用
智能座舱的「交互设计」大战
生成器版和查看器版有什么区别?
Network basic learning series four (network layer, data link layer and some other important protocols or technologies)
JS获得URL超链接的参数值
设置工作模式与环境(下):探查和收集信息
1067 Sort with Swap(0, i)
藏宝计划TreasureProject(TPC)系统模式开发技术原理
Create function report error, prompting DECLARE definition syntax problem
重发布实验报告
七夕?new一个对象
伴随着元宇宙、web3.0等概念的兴起,数字人、数字场景等诸多数字化的形态开始出现
complete binary tree problem