您的位置:首頁>熱點(diǎn)推薦 >

              動(dòng)態(tài)焦點(diǎn):#Uiautomation# 基于Uiautomation的微信自動(dòng)化

              2023-01-13 02:27:24    來源:程序員客棧

              “文章所涉及內(nèi)容更多來自網(wǎng)絡(luò),在此聲明,并感謝知識的貢獻(xiàn)者!”

              UI自動(dòng)化—

              UI編程包括但不限于UI界面的開發(fā),UI界面的測試。而本系列文章的主要側(cè)重于UI界面的自動(dòng)化操作。通過一段代碼實(shí)現(xiàn)電腦自行點(diǎn)擊、打開某文件或者修改某進(jìn)程的操作。


              (資料圖)

              UI控件識別

              UiSpy 下載

              (23條消息) windows 技術(shù)篇 - uispy 工具獲取和使用,windows窗口屬性快捷查看工具_(dá)掙扎的藍(lán)藻的博客-CSDN博客_uispy

              https://blog.csdn.net/qq_38161040/article/details/105491034

              FlatUInspect 源碼下載

              https://github.com/FlaUI/FlaUInspect

              FlatUInspect編譯運(yùn)行

              FlatUInspect 使用說明

              https://zhuanlan.zhihu.com/p/563909940?utm_id=0

              FlatUInspect 微信控件層次

              控件識別工具Inspect.exe下載

              https://www.shuzhiduo.com/A/6pdDZNkDJw/

              Window Inspector 下載

              https://www.jb51.net/softs/457644.html

              locale庫

              import locale

              #獲取系統(tǒng)語言

              if (locale.getdefaultlocale()[0] =="zh_CN"):

              pass

              subprocess庫

              啟動(dòng)程序

              import subprocess

              subprocess.Popen("3dmark-setup.exe")

              Uiautomation庫

              查找物件:

              1、WindowContrl(searchDepth,ClassName,SubName) 查找窗口中的程序,如果有中文則需用Unicode;可用window.Exists(maxSearchSeconds)來判斷此窗口是否存在;

              2、EditControl(searchFromControl) 查找編輯位置,找到后可用DoubleClick()來改變電腦的focus;edit.SetValue("string")輸入值;

              3、MenuItemControl(searchFromControl,Name) 查找菜單按鈕;

              4、ComboBoxControl(searchFromControl,AutomationI) 查找下拉框,然后在此基礎(chǔ)上用Select("name")方法來選擇需要的選項(xiàng);

              5、BottonControl(searchFromControl,Name,SubName) 查找按鈕;

              6、automation.FindControl(firefoxWindow,

              lambdac:(isinstance(c, automation.EditControl) or isinstance(c,automation.ComboBoxControl)) and c.Name == "Enter your search term") 按條件搜索handle

              點(diǎn)擊操作:

              單擊:.Click()

              雙擊:.DoubleClick()

              Click() 點(diǎn)擊;

              RighClik() 右鍵點(diǎn)擊;

              DoubleClick()

              SendKeys() 發(fā)送字符;

              SetValue() 傳值,一般對EditControl用;

              Win32API.SendKeys("string") 如果已在編輯位置,則可用此方法來輸入值,{Ctrl}為ctrl鍵,其他類似;{@ 8}格式可輸入8個(gè)@,對于數(shù)字也可實(shí)現(xiàn)此功能,但對于字母不能...;

              切換窗口

              import uiautomation as auto

              window=auto.WindowControl(ClassName="CabinetWClass",searchDepth=1) #控制面板窗口

              window.SwitchToThisWindow() # 切換窗口

              窗口最大化:

              window =auto.WindowControl(ClassName="CabinetWClass", searchDepth=1)

              window.Maximize()

              窗口操作

              subprocess.Popen("Name")   用進(jìn)程打開程序;

              window.Close()         關(guān)閉窗口;

              window.SetActive()     使用;

              window.SetTopMost()     設(shè)置為頂層

              window.ShowWindow(uiautomation.ShowWindow.Maximize) 窗口最大化

              window.CaptureToImage("Notepad.png") 截圖;

              uiautomation.Win32API.PressKey(uiautomation.Keys.VK_CONTROL) 按住Ctrl鍵

              uiautomation.Win32API.ReleaseKey(uiautomation.Keys.VK_CONTROL)釋放Ctrl鍵

              automation.GetConsoleWindow() #return console window that runs python,打開控制臺(tái)

              automation.Logger.ColorfulWriteLine("\nIwill open Notepad andautomate it. Please wait for a while.") 控制臺(tái)傳值(彩色字體),普通傳值用WriteLine;

              automation.ShowDesktop() 顯示桌面;

              微信自動(dòng)化

              獲取好友列表

              https://zhuanlan.zhihu.com/p/474166048

              獲取微信好友名單,可指定標(biāo)簽 & 全部

              https://gitcode.net/mirrors/Frica01/Wechat_mass_msg?utm_source=csdn_github_accelerator

              微信好友列表獲取(存儲(chǔ)到txt中)

              https://blog.csdn.net/m0_67391377/article/details/126065428

              python基于pywinauto實(shí)現(xiàn)PC端自動(dòng)化 python操作微信自動(dòng)化

              https://blog.51cto.com/u_15354476/3767938

              微信群發(fā)消息,獲取群通訊錄名單

              https://www.fdsml.com/zh/438398.html

              Python 實(shí)現(xiàn)獲取微信好友信息

              https://www.cnblogs.com/swjian/p/10597690.html

              微信好友列表獲取

              https://www.pudn.com/news/62e3f4b5864d5c73ac26b03a.html

              自動(dòng)發(fā)送微信消息

              參考資料

              (23條消息) Python UI自動(dòng)化 編程(一) UIAutomation_OKKLES的博客-CSDN博客_uiautomation

              https://blog.csdn.net/weixin_43393800/article/details/119105108

              Python使用uiautomation實(shí)現(xiàn)Windows平臺(tái)自動(dòng)化 - ooops! - 博客園 (cnblogs.com)

              https://www.cnblogs.com/jyang/p/11679828.html

              (23條消息) python UIAutomator2使用教程_Jepson2017的博客-CSDN博客_uiautomator2

              https://blog.csdn.net/d1240673769/article/details/113809889

              開源自己用python封裝的一個(gè)Windows GUI(UIAutomation)自動(dòng)化工具,支持MFC,WindowsForms,WPF,Metro,Qt - YinKaisheng - 博客園 (cnblogs.com)

              https://www.cnblogs.com/Yinkaisheng/p/3444132.html

              桌面應(yīng)用自動(dòng)化python——uiautomation API 如何找元素 - 白灰 - 博客園 (cnblogs.com)

              https://www.cnblogs.com/baihuitestsoftware/articles/9340462.html

              UIAutomation使用(一) -蝸牛學(xué)苑 (woniuxy.cn)

              https://www.woniuxy.cn/article/253

              用開源uiautomation自動(dòng)化操作火狐 - 知乎 (zhihu.com)

              https://zhuanlan.zhihu.com/p/30409594

              Python下編寫Windows自動(dòng)化測試軟件 - 簡書 (jianshu.com)

              https://www.jianshu.com/p/be3c46c7a905

              python:獲取微信好友列表信息(二)進(jìn)行導(dǎo)出微信好友到csv數(shù)據(jù)讀取與處理

              https://blog.csdn.net/seoyundu/article/details/81543756

              關(guān)鍵詞: 好友列表 切換窗口 自動(dòng)化操作

              相關(guān)閱讀

              亚洲V无码一区二区三区四区观看 亚洲αv久久久噜噜噜噜噜 | 亚洲精品视频在线看| 亚洲成网777777国产精品| 亚洲AV无码一区东京热| 亚洲精品无码久久久久| 亚洲国产精品无码久久九九大片| 亚洲精品无码mv在线观看网站| 久久久久久亚洲精品不卡| 7777久久亚洲中文字幕| 亚洲色婷婷综合久久| 国产综合激情在线亚洲第一页| 亚洲无删减国产精品一区| 亚洲精品WWW久久久久久| 亚洲毛片av日韩av无码| 亚洲国产成人久久综合区| 亚洲精品动漫人成3d在线 | 久久亚洲国产中v天仙www| 亚洲第一se情网站| 亚洲乱码一二三四区国产| 久久亚洲精品中文字幕无码| 亚洲精品成人久久久| 亚洲真人日本在线| 亚洲AV成人无码久久WWW| 亚洲一级大黄大色毛片| 色噜噜亚洲男人的天堂| 亚洲中文字幕无码mv| 亚洲高清不卡视频| 精品国产_亚洲人成在线高清 | 亚洲av一本岛在线播放| 亚洲色丰满少妇高潮18p| 亚洲精品视频免费看| 国产亚洲色婷婷久久99精品| 亚洲AV综合色区无码另类小说| 亚洲高清在线视频| 久久精品九九亚洲精品天堂| 亚洲bt加勒比一区二区| 亚洲国产精品午夜电影| 中文字幕亚洲综合久久| 亚洲AV综合色区无码二区偷拍| 亚洲日韩一区二区三区| 亚洲高清视频一视频二视频三|