Questions tagged [pywinauto]

Windows GUI automation library written in Python

pywinauto
Filter by
Sorted by
Tagged with
9 votes
1 answer
25k views

Python - Control window with pywinauto while the window is minimized or hidden

What I'm trying to do: I'm trying to create a script in python with pywinauto to automatically install notepad++ in the background (hidden or minimized), notepad++ is just an example since I will ...
Carlos Barros's user avatar
24 votes
3 answers
50k views

How to get a list of the name of every open window?

How do I get a list of the name/text of all opened windows? I tried pywinauto: pywinauto.findwindows.find_windows(title_re="*") but using * as a regex raises an error I tried win32gui: It has ...
user10385242's user avatar
5 votes
1 answer
2k views

ctypes.ArgumentError when using kivy with pywinauto

I have a kivy application that can interact with other windows using the pywinauto module. The application works fine in Linux (where pywinauto isn't used) but in Windows I get the following error, ...
qr7NmUTjF6vbA4n8V3J9's user avatar
2 votes
2 answers
4k views

How can I get a url from Chrome by Python?

I'm trying to use Pywinauto to get the Chrome tab's url like this: (pseudo code) Press F6 to direct url line. Ctrl + C to copy url Get the url from scrapbook Deal with the url by BS4, Requests, ...
Mars Lee's user avatar
  • 1,915
1 vote
1 answer
6k views

how to switch between two application using pywinauto 0.5.4

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 ...
Prince's user avatar
  • 15
0 votes
0 answers
433 views

python pywinauto how to control custom gui. (gui made by C++ or C#) want control GUI and save file

<I modify question , depend on some comment, I have update my inquiry.> >>> I already study from various web site. using pywinauto in PYTHON,, and save a file... I can do it like ...
Choi Joseph's user avatar
4 votes
2 answers
7k views

How To Press <CTRL>

from pywinauto import application app = application.Application.start("C:\\Program Files\\Microsoft Office\\Office12\\EXCEL.exe") app.Microsoft_Excel.TypeKeys('%a') %a = Alt + a I Want Ctrl + a. is ...
Dobz's user avatar
  • 1,213
4 votes
1 answer
5k views

Cannot import from pywinauto: ImportError: DLL load failed while importing win32ui: A dynamic link library (DLL) initialization routine failed

After installing pywinauto I'm trying to run that simple code: from pywinauto import Application filename = 'notepad.exe' app = aplication.Application().start(filename) And get the error: Traceback (...
Edu V Magadan's user avatar
4 votes
2 answers
8k views

pywin32 / pywinauto not working properly in remote desktop when it is minimized

I have a Jenkins pipeline that executes a program in a remote server that uses pywin to manipulate an application for functional tests. My application works great while I have the remote desktop ...
Ana Franco's user avatar
  • 1,701
3 votes
1 answer
10k views

pywinauto: MenuSelect() Cannot be used to select "MenuBar" in some applications. What is a suitable function from this library to use?

I automate tests for an application called "Team Developer" belongs to Gupta Technology. It has a Menu bar not a menu. I'm not able to select the menu by MenuSelect(), and it shows "raise RuntimeError(...
ramtin mehraban teymouri's user avatar
3 votes
1 answer
2k views

Getting error while running a script which uses pywinauto

Whenever I import pywinauto I am getting below error: Traceback (most recent call last): File "D:\Python\Python38\lib\ctypes_init_.py", line 123, in WINFUNCTYPE return _win_functype_cache[(...
Ravi's user avatar
  • 39
1 vote
1 answer
4k views

How to control IE Explorer with pywinauto

Ok, so I want to control a IE Explorer with pywinauto. I would like to select text fields on the page and edit them. Is there a way to do this with pywinauto without clicking where the text field are? ...
Tom's user avatar
  • 856
-1 votes
1 answer
698 views

SetCursorPos fail with "the parameter is incorrect" after rdp session terminated

I have application running on win 2008 server. It is using win32 api and it works just fine when i connected to the server with RDP. When i disconnect every call to SetCursorPos end with this failure. ...
yabloki's user avatar
  • 311
25 votes
4 answers
11k views

pytest - Windows fatal exception: code 0x8001010d

I am trying to run a GUI test using pytest and pywinauto. When I run the code normally, it does not complain. However, when I am doing it via pytest, it throws a bunch of errors: Windows fatal ...
Joe's user avatar
  • 383
6 votes
2 answers
10k views

How to right click on a folder and select from context menu using pywinauto?

I'm writing automation tests for a cloud syncing desktop application. The problem I'm facing is that I cannot select a sub-folder from a window and I cannot select an option from context menu when ...
Adrian Rosu's user avatar
5 votes
2 answers
7k views

Checking a checkbox with pywinauto doesn't work

I installed the last pywinauto module from pip. I don't know how to use the Check(), UnCheck(), GetCheckState() methods. This is my very simple code sample. from pywinauto import application # ...
baltazer's user avatar
  • 259
5 votes
1 answer
10k views

pywinauto: Iterate through all controls in a window

I'm trying to write a general test script to find errors in new software builds. My idea is to iterate through the controls in the window and interact with each one, logging any errors that are caused ...
Aric's user avatar
  • 319
5 votes
1 answer
12k views

pywinauto 32-bit userwarning

I am trying to use pywinauto to automate TomCat to start and stop every time I update the class files. However, when I try and run it it gives me the following warning: UserWarning: 32-bit ...
DanZoe's user avatar
  • 121
4 votes
1 answer
5k views

Using PyWinAuto (or anything else) to interact with hidden icons on the taskbar

I am trying to find and click a hidden icon on the taskbar (shown by clicking the white triangle) in windows 7, using python. I've been trying to use pywinauto for this, but it doesn't seem to have ...
Richard Tweeddale's user avatar
4 votes
1 answer
13k views

How do I send keystrokes to a background window using Python & pywinauto without bringing that window into the foreground?

Tried this code: import win32gui import win32con windowID = win32gui.FindWindow(None, "testing.pdf - Adobe Acrobat Pro DC") #win32gui.SetForegroundWindow(windowID) win32gui.SendMessage(...
English Rain's user avatar
4 votes
2 answers
12k views

pywinauto: How to select this dialog? Which spying tool to use? What information do I need on it?

How can I write "hello" on the first field of the 7-zip "Add to Archive" dialog? I managed so far to trigger the 7-zip (windows 64x) "Add to Archive" dialog using this from pywinauto.application ...
J. Does's user avatar
  • 793
3 votes
2 answers
14k views

How to send SendKeys to Windows form in python script?

I'm doing automation scripting in Python for my desktop application. In that I'm sending TAB key/any key to my windows form. But I'm not able to find handle of that Windows form in my Python script. ...
Ajit Medhekar's user avatar
3 votes
1 answer
12k views

Remote desktop connection using pywinauto

I want that my script will automate to remote desktop connection. My problem is how will i able to send text in a script in loggin in into the remote desktop connection in password area. Below is my ...
Software Developer's user avatar
3 votes
1 answer
7k views

How to click a 'next' button of a window using python

I used the below code to connect a opened window(Class type is SunAwtFrame), indeed I able to connect to it. but unable to click next button of it, my doubt is that 'Next' button may reside inside the ...
kgopi's user avatar
  • 141
3 votes
2 answers
10k views

Pywinauto how do I get the list of returned elements

I'm using a WPF application that has custom stack panel, which is basically a list. The item in the list is exactly the same so I'm not able to select a specific text to uniquely identify the elements....
user8678153's user avatar
3 votes
2 answers
5k views

pywinauto capture_as_image adds unwanted borders

I am using pywinauto to take a screenshot of a specific window. Here is the code I use to take a capture of notepad ("Bloc-notes" in french) : from pywinauto import Application app = Application()....
Simpom's user avatar
  • 948
2 votes
1 answer
4k views

pywinauto does not detect child window

I'm using the latest version (to date) of pywinauto; and also using PyInspect (uia) to identify controls. I'm automating controls on an application, and part of the process is to check a few boxes on ...
like2think's user avatar
2 votes
1 answer
2k views

automation using pywinauto to click on start button

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 ...
Trilok M's user avatar
  • 701
2 votes
1 answer
1k views

Python - pywinauto iface_value.GetValue() Not working, is it because the window selected has no such attribute?

I am automating c# based application in which some web page embedded. And I am trying to get data value from table of the page with using dlg_list.iface_value.GetValue(),error occurs as follows, D:\...
Avery's user avatar
  • 21
2 votes
0 answers
1k views

How To Click On Telegram Contacts Menu With Pywinauto

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 >>> ...
Sh3ikh's user avatar
  • 21
2 votes
2 answers
1k views

python --> pyinstaller - .exe file will return "test returned -1"

[1] The code is: import Tkinter from Tkinter import * # Create Tk instance root = Tkinter.Tk(className="test") # Open Notepad def openNotepad(): import pywinauto app = pywinauto.Application....
george's user avatar
  • 705
2 votes
1 answer
681 views

Windows GUI Automation on legacy app

I'm trying to automate an old windows app called FacTel5. I've been able to automate the login part but the next form is a bullet-like list whose controls are not showing, neither on pywinauto ...
EndermanAPM's user avatar
2 votes
1 answer
476 views

Error during automated software install using pywinauto

After searching I am not able to find a good response: I am trying to automate company software using pywinauto. I try to use app.print_control_identifiers() wherever possible. And it has been a God ...
DenverDave's user avatar
2 votes
1 answer
2k views

The windows application automating using pywinauto does not detect elements inside a TreeView, despite the elements have there own characteristic

The application I am automating is a win32 supported backend application and using inspect.exe to detect the elements Below is my code trying to click on sales receipt element, on execution I get ...
mani's user avatar
  • 23
2 votes
1 answer
4k views

pywinauto: accessing chrome gui

I am trying to select a printer and print on chrome browser, using pywinauto, but I am not able to access the gui components. I can see the components in Microsoft Inspect.exe in UIAutomation mode. (...
Kumar Gaurav's user avatar
2 votes
2 answers
1k views

Cannot handle PYWINAUTO related exceptions with `try except` block in Python properly?

My main goal: Automating Zoom my zoomModule.py file is: import os, pywinauto from pywinauto import Desktop from pywinauto import findwindows from pywinauto.application import Application from ...
Curious Learner's user avatar
2 votes
1 answer
3k views

How to search children/descendants by regular expression title in pywinauto?

I am trying to get children/descendant UI elements of another UI element by a regexp title. For example, the following code should work. from pywinauto.application import Application, ...
Elijas Dapšauskas's user avatar
2 votes
2 answers
5k views

Resizing Notepad via pywinauto

I need to resize the notepad using python pywinauto library. I am using the below code to start the notepad:- from pywinauto import application app = application.Application() app.start("Notepad....
Ankit batra's user avatar
2 votes
2 answers
2k views

Pywinauto type_keys() omits "%" in string

When attempting to input a string 'customer asked for 30% discount' to a form by using type_keys() in Pywinauto 0.6.5, the output it sends is 'customer asked for 30 discount" omitting '%'. Tried ...
Redem's user avatar
  • 21
1 vote
2 answers
1k views

Py2Exe error caused by pywinauto on some systems: "AttributeError: 'module' object has no attribute 'CUIAutomation"

I'm rolling out an EXE to several Windows 2012 R2's and the majority of them work just fine. However, seemingly under the same condition, I have a handful that spit out the error: AttributeError: '...
Morty's user avatar
  • 23
1 vote
1 answer
1k views

find qwidget object text by using pywinauto

I work as a test engineer. I have to test an application(softphone) which is done by using QWidget. I'm using python - pywinauto. I can click buttons and make calls. There is a qwidget object named ...
user1239882's user avatar
1 vote
1 answer
3k views

Pywinauto unable to find/close pop-up window

Source code def is_admin(): try: return ctypes.windll.shell32.IsUserAnAdmin() except: return False if is_admin(): app = Application(backend='uia').start("C:\\Program ...
Sin Han Jinn's user avatar
1 vote
1 answer
2k views

How can I get all ListItem in ListBox?

Good day, everyone! I use pywinauto to automation desktop application. And I need to receive all ListItems from ListBox. Then I execute this code: def common_list(list_control): state = ...
Denis_N's user avatar
  • 31
1 vote
2 answers
5k views

How to get specific system tray icon using pywinauto?

For example the Slack icon from the notification area: And how can we get a specific icon in case of "show hidden" icons option?
Sunil Kumar's user avatar
1 vote
1 answer
2k views

“Inspect.exe” can't find some elements on my laptop, why?

I want to automate an application via Pywinauto on my laptop but all the elements are not seen. “Inspect.exe” cannot find some elements of my application on my laptop whilst it finds them on other ...
David Pratmarty's user avatar
1 vote
2 answers
802 views

PIP install packages but some not found

Some pip installs don't work on a computer, since recently I changed to Python 3. for example, pywinauto I used CMD: C:\Users\NAME\AppData\Local\Programs\Python\Python37-32\Scripts>pip install ...
Mark K's user avatar
  • 9,094
1 vote
1 answer
584 views

Not able to automate button click on "Oracle VM virtual box" using pywinauto in python

I am working on the Automation of loading an image file in "Oracle VM Virtual box" to create a virtual machine using Pywinauto in python. I am able to automate the installation of Virtual Box software ...
VarRa's user avatar
  • 11
1 vote
1 answer
2k views

pywinauto can it be made cross platform

My Python application has windows is client and server as Linux. My aim is to automate windows GUI application with pywinauto from Linux server. Can pywinauto be made cross platform?
Naveen Raj's user avatar
1 vote
1 answer
6k views

Unable to access windows controls inside pywinauto's hwndwrapper (wrapper class

I am new to python and pywinauto. Trying to set or get Text for TextBox (windows control) inside pywinauto.controls.hwndwrapper.hwndwrapper by using SWAPY, I have Class Name of wrapper class. How to ...
Naveen Raj's user avatar
1 vote
0 answers
206 views

Installing Unsigned drivers

I am trying to automate some stuff where I am installing certain drivers. However as the drivers are unsigned I am seeing attached security dialogue. I want to automate and click "Install" or "Don't ...
RazerX's user avatar
  • 11