pywinauto

Pywinauto TypeError: start() missing 1 required positional argument: 'self'

血红的双手。 提交于 2019-12-11 18:26:27
问题 Hello I faced a problem: import pywinauto from pywinauto.application import Application app = Application.start(cmd_line="C:\Folder\Wow.exe") Traceback (most recent call last): File "<input>", line 1, in <module> TypeError: start() missing 1 required positional argument: 'self' What shall I add to code? 回答1: You need to instantiate the Application object and call start on that, not on the class. As the documentation shows: app = Application(backend="uia").start('notepad.exe') In your case I

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

时光毁灭记忆、已成空白 提交于 2019-12-11 15:58:10
问题 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 computers. For example on my laptop “Inspect.exe” cannot show highlight rectangle of the leaves of a treeview whilst it can on other computers. How can i fix it on my laptop? Is it a setting of the Os (Windows 7) or a setting of "inspect.exe"? 回答1: I finally managed to have all the elements of my

Installing Unsigned drivers

99封情书 提交于 2019-12-11 11:54:26
问题 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 Install" on the security dialog. Till now I have tried certain options like pywinauto, WASP and AutoIt but nothing seemed to work. Below are the options I have tried so far: WASP Select-Window -title "Windows Security"| Set-WindowActive | Send-Keys "%n" Select-Window -title "Windows Security | Set

pywinauto can it be made cross platform

江枫思渺然 提交于 2019-12-11 10:10:39
问题 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? 回答1: It's not possible using pywinauto immediately. But you may copy pywinauto script to the target Windows machine and run it remotely using Jenkins, for example. Or any other CI server. Master node can be on Linux. So Windows node can run as a slave. But there are several requirements for the Windows slave

Remote desktop connection using pywinauto

假如想象 提交于 2019-12-11 09:55:08
问题 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 script from pywinauto.application import Application import win32api import pywinauto from pywinauto import keyboard from pywinauto import timings import time from pywinauto.keyboard import SendKeys app = Application().Start(cmd_line=u'"C:\Windows\system32\mstsc.exe" ') pywinauto.mouse.move(coords

Pywinauto how do I get the list of returned elements

萝らか妹 提交于 2019-12-11 07:43:56
问题 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. And some other values such as time are dynamic. Is there a way for me to get the list of elements returned. I know it's possible because the error was thrown, ElementAmbiguousError state the count. If I could do that, then from that list I can use the index and validate what I need. 回答1: You

pywinauto change default timeout values

心不动则不痛 提交于 2019-12-11 04:25:06
问题 I am using Timings.Defaults() in my pywinauto/python code. However, for certain operations like app.window_(title_re = windowTitle).Wait('visible', timeout=1) code waits for 5 seconds if the window is not visible. I have given timeout as 1 seconds but still it waits for 5 seconds. How do I change this 5 second wait to a shorter time? 回答1: The bug with timings is fixed in pywinauto 0.6.3. Please update it with pip install -U pywinauto . 来源: https://stackoverflow.com/questions/43558087

Windows GUI Automation on legacy app

岁酱吖の 提交于 2019-12-11 04:09:58
问题 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 control_identifiers or Windows Inspect from pywinauto.application import Application app = Application(backend="uia").start(r'C:\Factel5\Factel5.exe') controlAcceso = app.FacTel5['Control de acceso a FacTel5'].GroupBox user = controlAcceso.child_window(auto_id="4", control_type="Edit") user.type_keys(

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

别来无恙 提交于 2019-12-11 03:56:28
问题 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("There is no menu.")" error. import pywinauto import time from pywinauto.application import Application app = Application.start('C:\Program Files (x86)\Gupta\Team Developer.exe') pywinauto.application.Application() time.sleep(2) MenuItms = app.window_(title_re = "Gupta*").MenuSelect("File->Exit"

pywinauto: Iterate through all controls in a window

Deadly 提交于 2019-12-11 00:27:48
问题 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 and restarting the software if it crashes. I'm looking for a way to dynamically find control identifiers, a bit like print_control_identifiers() but with the output being a list or similar structure which I can iterate through. On a GitHub question about control identifiers this was mentioned: