当前位置:网站首页>学习笔记 | 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()
鱼竿给你了,剩下的自己钓鱼吧!
边栏推荐
- 数据分析知识点搜集(纯粹的搜集)
- BMN: Boundary-Matching Network for Temporal Action Proposal Generation Reading Notes
- 简单了解下 TCP,学习握手和挥手以及各种状态到底是怎么样的
- MiniAPI of .NET6 (14): Cross-domain CORS (Part 1)
- Republish the lab report
- 举一个 web worker 的例子
- Kotlin - 扩展函数和运算符重载
- The sword refers to the offer question 22 - the Kth node from the bottom in the linked list
- Scala basics [regular expressions, framework development principles]
- [2022强网杯] polydiv和gamemaster
猜你喜欢
Network basic learning series four (network layer, data link layer and some other important protocols or technologies)
Deep integration of OPC UA and IEC61499 (1)
智能座舱的「交互设计」大战
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
HCIP BGP lab report
射频芯片(RFIC)的协议之5G及其调制
藏宝计划TreasureProject(TPC)系统模式开发技术原理
禾匠编译错误记录
【论文阅读】TRO 2021: Fail-Safe Motion Planning for Online Verification of Autonomous Vehicles Using Conve
物联网新零售模式,引领购物新潮流
随机推荐
rsync 基础用法
SRE运维解密-什么是SRE:DevOps模型的具体实践!
Testng监听器
Quickly build a website with static files
设置工作模式与环境(下):探查和收集信息
2022/8/3 考试总结
Zilliz 2023 Fall Campus Recruitment Officially Launched!
重发布实验报告
689. 三个无重叠子数组的最大和
用队列模拟实现栈
AOSP CameraLatencyHistogram的原理与使用
智能座舱的「交互设计」大战
Work Subtotal QT Packing
一个函数有多少种调用方式?
直播预告 | 构建业务智联,快速拥抱财务数字化转型
Kotlin - extension functions and operator overloading
ML之interpret:基于titanic泰坦尼克是否获救二分类预测数据集利用interpret实现EBC模型可解释性之全局解释/局部解释案例
Deep integration of OPC UA and IEC61499 (1)
First domestic open source framework 】 【 general cloud computing framework, any program can be made into cloud computing.
Unity2021发布WebGL雾效消失问题