pywinauto

How to select a sub menu from a context menu?

ε祈祈猫儿з 提交于 2020-03-05 05:52:29
问题 I am trying to click on a sub menu(BTDecoder) item from a context menu(send to) using pywinauto. I could click on the menu item from context list and click on it. But when i try to click on sub menu, its not happening. its showing there is no item like that. Here is my code : path=os.path.realpath(path) os.startfile(path) # open the folder named "FW" app = pywinauto.Desktop(backend='uia').window(best_match='FW') win = app.window(title_re='WRT_FW_27_12_2018_11_19_59_000001') win.click_input

How to select a sub menu from a context menu?

心不动则不痛 提交于 2020-03-05 05:52:11
问题 I am trying to click on a sub menu(BTDecoder) item from a context menu(send to) using pywinauto. I could click on the menu item from context list and click on it. But when i try to click on sub menu, its not happening. its showing there is no item like that. Here is my code : path=os.path.realpath(path) os.startfile(path) # open the folder named "FW" app = pywinauto.Desktop(backend='uia').window(best_match='FW') win = app.window(title_re='WRT_FW_27_12_2018_11_19_59_000001') win.click_input

How to perform a context menu action on a file using python 3

余生颓废 提交于 2020-02-25 09:57:08
问题 How can i do a context menu action on a particular file? I managed to open the explorer and get the list of files through python using pywinauto. On that file I need to perform a context menu action, is it possible through pywinauto? import pywinauto path = "C:\\Users\\Vishnu\\Desktop\\DM-test\\" pywinauto.Application().Start(r'explorer.exe') explorer = pywinauto.Application().Connect(path='explorer.exe') NewWindow = explorer.Window_(top_level_only=True, active_only=True, class_name=

Locking in multi-threaded pywinauto send keys

大城市里の小女人 提交于 2020-02-07 02:37:25
问题 I'm new to pywinauto and I'm creating several notepad windows and typing a text in all of them. However, this is not dependent on each other, so this can be run concurrently using threads. However, when I try to do the same, the text get messed up because there are several threads trying to access the type_keys() method at the same time. Is there any way I can achieve the same concurrently? 回答1: There is another method .set_text("...") that doesn't require window to be in focus. It's

import pywinauto错误

别说谁变了你拦得住时间么 提交于 2020-02-04 14:21:35
真是不明白,我在部分win7电脑直接pip install pywinauto 就可以。但是又有几部电脑安装pywinauto后,import pywinauto 就是有下面的错误。 Python 3.8 .1 ( tags / v3 . 8.1 : 1b293b6 , Dec 18 2019 , 22 : 39 : 24 ) [ MSC v . 1916 32 bit ( Intel ) ] on win32 Type "help" , "copyright" , "credits" or "license()" for more information . >> > Traceback ( most recent call last ) : File "D:\Python38-32\lib\ctypes\__init__.py" , line 123 , in WINFUNCTYPE return _win_functype_cache [ ( restype , argtypes , flags ) ] KeyError : ( < class 'ctypes.HRESULT' > , ( < class 'ctypes.c_long' > , < class 'comtypes.automation.tagVARIANT' > , < class 'ctypes.c

how to switch between two application using pywinauto 0.5.4

微笑、不失礼 提交于 2020-01-23 16:11:30
问题 I am trying to automate a task of copying every single line one by one from Notepad and pasting it the application and then clicking at a button and then copying the output to a third notepad file. I am using pywinauto 0.5.4 of python for this automation and I am not getting any help on how to switch between different application from pywinauto import application app = application.Application() app = application.Application() app.start("Notepad.exe") app.start("C:\Program Files (x86)\eSpeak

How To Click On Telegram Contacts Menu With Pywinauto

不羁岁月 提交于 2020-01-15 09:06:41
问题 I Want To Click On The Contacts Menu In Telegram With Pywinauto . I Run This Code But Has Error : >>> import pywinauto >>> from pywinauto.application import Application >>> app = Application.start ("C:\Users\Ali\AppData\Roaming\Telegram Desktop\Telegram.exe") >>> app.Telegram.MenuSelect ("Contacts") Traceback (most recent call last): File "<pyshell#5>", line 1, in <module> app.Telegram.MenuSelect ("Contacts") File "C:\Python27\lib\site-packages\pywinauto-0.5.1-py2.7.egg\pywinauto\application

python pywinauto GUI自动测试

限于喜欢 提交于 2020-01-13 17:19:35
今天同事问了我一嘴,怎么实现GUI自动化,想起来以前用过的pywinauto,自己也玩了一把,好久没用了,生疏了哈哈哈 代码如下 from pywinauto . application import Application import time from pywinauto . findwindows import find_windows , find_elements app = Application ( ) . start ( r 'C:\Users\XChen32\Desktop\WindowsFormsApp1\WindowsFormsApp1\bin\Debug\1.exe' ) time . sleep ( 5 ) s = app . window ( title = 'Form1' ) time . sleep ( 2 ) print ( s . print_control_identifiers ( ) ) s [ 'button2' ] . click ( ) ss = app . window ( title = 'Form2' ) time . sleep ( 2 ) print ( ss . print_control_identifiers ( ) ) ss [ 'Edit2' ] . type_keys ( 'lllll' ) ss [

automation using pywinauto to chick on start button

元气小坏坏 提交于 2020-01-06 09:05:04
问题 I am new to python pywinauto and I want to automate a simple step of clicking on windows start button to open control panel and selecting Administrative tools and finally want to check if the check box is checked or not. I'm stuck in the fist step of how to click on windows start button ? 回答1: from pywinauto import Application Application().start(r'mmc printmanagement.msc') # Warning! it spawns child process # connect to that child process app = Application(backend="uia").connect(path='mmc

automation using pywinauto to chick on start button

感情迁移 提交于 2020-01-06 09:02:13
问题 I am new to python pywinauto and I want to automate a simple step of clicking on windows start button to open control panel and selecting Administrative tools and finally want to check if the check box is checked or not. I'm stuck in the fist step of how to click on windows start button ? 回答1: from pywinauto import Application Application().start(r'mmc printmanagement.msc') # Warning! it spawns child process # connect to that child process app = Application(backend="uia").connect(path='mmc