pywinauto

ctypes.ArgumentError when using kivy with pywinauto

主宰稳场 提交于 2019-12-19 08:14:47
问题 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, the application won't even start up: C:\Program Files (x86)\Python36_64\lib\site-packages\pywinauto\__init__.py:80: UserWarning: Revert to STA COM threading mode warnings.warn("Revert to STA COM threading mode", UserWarning) [INFO ] [GL ] NPOT texture support is available [INFO ] [Base ] Start

using variables in place of control and value pywinauto

[亡魂溺海] 提交于 2019-12-14 04:22:41
问题 How to use variables in place of list of properties (controls=values) to identify the objects? I'm trying to achieve something like below giving me error, "Can't assign to function call" def main(): parser = argparse.ArgumentParser() parser.add_argument("target_combo_box_property", action='store_true') parser.add_argument("target_combo_box_value", type=int) parser.add_argument("target_searched_string") args = parser.parse_args() app = Application(backend='win32').connect(path="app.exe")

Open an existing excel workbook using pywinauto

半世苍凉 提交于 2019-12-13 20:55:24
问题 So far I've seen examples of invoking an Excel Application using pywinauto. Can I open an existing Excel Workbook using pywinauto ? 回答1: You Don't even need pywinauto for this. Just open excel with subprocess and use command line switches to open your doc But if you insist on using pywinauto Then Try .MenuSelect("File -> Open") Then .Edit.TypeKeys("*Filename with absolutepath*", with_spaces = True) Then .No.Click() Or something to that effect if those are not the actual elements names 来源:

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

拜拜、爱过 提交于 2019-12-13 05:34:11
问题 enter image description hereI 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 access controls inside wrapper class using class name (like Afx:633C0000:1008 ) in pywinauto? import pywinauto import pywinauto.controls from pywinauto.application import Application app = Application().Connect(title=u'SAP', class_name='SAP_FRONTEND_SESSION')

Automation Microsoft SQL Server 2008 R2 using Python(pywinauto)

我怕爱的太早我们不能终老 提交于 2019-12-13 04:32:21
问题 I am creating Microsoft SQL Server Management Studio Automation tool using python . The problem is I can't select the Child_tree (Northwind) database It's selecting the Parent_tree (Databases). I need to do much more, clicking the child_tree(Northwind) right click option (Ex. Tasks-> backup). Help me to do the best automation code. Thanks in Advance. import pywinauto import socket import binascii host = socket.gethostname() #Getting system host name n2 = int(

How to get specific system tray icon using pywinauto?

一世执手 提交于 2019-12-13 03:44:18
问题 For example the Slack icon from the notification area: And how can we get a specific icon in case of "show hidden" icons option? 回答1: This worked for me, If your app icon are visible on taskbar app = Application(backend="uia").connect(path="explorer.exe") sys_tray = app.window(class_name="Shell_TrayWnd") sys_tray.child_window(title=<your icon>).click() In-case application icon which in hidden tray app = Application(backend="uia").connect(path="explorer.exe") st = app.window(class_name="Shell

Upload a file using WebDriver & PyWinAuto

六月ゝ 毕业季﹏ 提交于 2019-12-13 03:03:35
问题 I have a python script that tries to upload a file from my PC to a web application. I press via WebDriver the specific upload button in the browser and then a Win7 explorer window opens for me to navigate and select the desired file to upload. How could I manipulate this window with pywinauto? optional: could this be done in linux as well (with an appropriate library I suppose) ? This is my sample code: wd.find_element_by_css_selector("img.editLecturesButtons.fromVideo").click() #switch to

python - Auto input typekeys to cmd process that has admin privileges - Using pywinauto

扶醉桌前 提交于 2019-12-13 02:49:08
问题 I have a cmd process running with admin rights. I need to be able to automate some commands. Example echo Testing MUST connect to existing Admin cmd process. (The cmd must be launched from here Location: C:\windows\system32\ComputerDefaults.exe). Currently i can connect to a cmd process with normal rights and send code. from pywinauto import Application app = Application().connect(process = 16364) dlg = app.top_window_() dlg.TypeKeys('hello world') However i can not connect to my cmd with

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

跟風遠走 提交于 2019-12-13 01:50:49
问题 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, WindowSpecification root_ws: WindowSpecification = ( Application(backend="uia") .connect(path="C:/program.exe") .window(title_re="^Program *") ) root_ws.descendants(title_re="^abc*", control_type="DataItem") However, as described (by Vasily Ryabov) in this comment, title_re is not possible for children

pywinauto qwidget click triggers no action

早过忘川 提交于 2019-12-12 10:21:03
问题 It is visibly that a QWidget button is pressed and released, unfortunately no action is triggered. The environment is similar to find qwidget object text by using pywinauto. The code has resorted to use of absolute coordinates from How to click a 'next' button of a window using python. Once the program runs, the target window will get focus. The cursor starts to be somewhere close to the center of the target window. Then it moves to the button, presses the button since the color changes to