pywinauto

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

蹲街弑〆低调 提交于 2019-12-01 11:30:24
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 oppened but when I close the remote desktop and run it from Jenkins, the app gets lost. What I do is to open the app and send an enter key. This is my app: os.startfile("C:\\Program Files (x86)\\SAP\\FrontEnd\\SAPgui\\saplogon.exe") time.sleep(5) handle = win32gui.FindWindow(0, "SAP Logon 740") keyboard = Controller() keyboard.press(Key.enter) So I tried to add focus to the app to force the focus

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

自作多情 提交于 2019-12-01 07:30:02
问题 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 oppened but when I close the remote desktop and run it from Jenkins, the app gets lost. What I do is to open the app and send an enter key. This is my app: os.startfile("C:\\Program Files (x86)\\SAP\\FrontEnd\\SAPgui\\saplogon.exe") time.sleep(5) handle = win32gui.FindWindow(0, "SAP Logon 740")

pywinauto教程2

被刻印的时光 ゝ 提交于 2019-11-27 04:44:11
一、环境安装 1.命令行安装方法 pip install pywinauto==0.6.7 2.手动安装方法 安装包下载链接: pyWin32: python调用windows api的库 https://sourceforge.net/projects/pywin32/files/pywin32/Build 220/ comtypes: COM接口的调度 https://github.com/enthought/comtypes/releases six: 用来兼容Python2和Python3的库 https://pypi.org/project/six/ Pillow:可选,用来做屏幕截图的 https://pypi.org/project/Pillow/2.7.0/ Pywinauto:PC端自动化工具 https://github.com/pywinauto/pywinauto/releases 解压缩后执行 python setup.py install 注:建议使用第一种命令行安装,方便。 3.环境检查 命令行中打开python解释器,运行以下代码,windows自带的记事本会被启动,若无报错,则证明pywinauto已安装成功。 1 2 from pywinauto.application import Application app = Application

【转】pywinauto教程

Deadly 提交于 2019-11-27 04:43:36
一、环境安装 1.命令行安装方法 pip install pywinauto==0.6.7 2.手动安装方法 安装包下载链接: pyWin32: python调用windows api的库 https://sourceforge.net/projects/pywin32/files/pywin32/Build 220/ comtypes: COM接口的调度https://github.com/enthought/comtypes/releases six: 用来兼容Python2和Python3的库 https://pypi.org/project/six/ Pillow:可选,用来做屏幕截图的 https://pypi.org/project/Pillow/2.7.0/ Pywinauto:PC端自动化工具 https://github.com/pywinauto/pywinauto/releases 解压缩后执行 python setup.py install 注:建议使用第一种命令行安装,方便。 3.环境检查 命令行中打开python解释器,运行以下代码,windows自带的记事本会被启动,若无报错,则证明pywinauto已安装成功。 from pywinauto.application import Application app = Application

python免安装版(绿色版)制作

半世苍凉 提交于 2019-11-26 13:19:15
一、实验环境 1.Windows7x64_SP1 二、需求背景 个人编写了一个软件安装器,用于一键安装开发软件及工具,该工具基于python + pywinauto。 但问题来了,新电脑上未安装python和图像界面操作库pywinauto,难道先手动安装python + pywinauto,再运行软件安装器安装其他软件? 有两种解决方式 2.1 方式一: 使用PyQt制作GUI界面,再使用pyinstaller打包为exe文件,该exe程序可以在未安装python的电脑上运行。 使用该方式,最终发现PyQt库和pywinauto库冲突,可以正常打包,但exe程序运行报错,打开控制台窗口,窗口提示“ImportError:The 'appdirs' package is required”。 本打算在github上向pywinauto的作者发帖提问,为方便其复现问题,手动编写图形化界面(未使用Qt设计师),程序运行正常!得出结论是Qt设计师编写的代码与pywinauto库存在冲突。 2.2 方式二: 使用绿色版python,在cmd中调用软件安装器,这样就可以安装python及相关软件和工具。 三、实验步骤 3.1 下载python release版 下载链接请参考如下,下载其中的python-3.7.3rc1-embed-win32.zip https://www.python