0

Hi I am trying to click a button on a pop up to install something.

from pywinauto import application
app = application.Application()
app.WindowsSecurity.Install.Click()

This code is working fine for Windows 2k8 but on Windows 2k12 is not working. I think because of the GUI change it's not happening. I am able to catch the pop up but not able to click on the install button. I am getting control identifiers. Can you help me in order to click on that button?

Control Identifiers

Vasily Ryabov
  • 9,386
  • 6
  • 25
  • 78
Rahul V
  • 1
  • 2
  • What is the output / traceback of the script? It should be more useful than `print_control_identifiers()` output. – Vasily Ryabov Apr 22 '16 at 10:24
  • on execution of the above code i am getting no output.. only the pop up box is getting selected.. and after that nothing is happening. Tried this also : a = app.connect(title_re = "Windows.*") window.SetFocus() window.Install.Click() – Rahul V Apr 25 '16 at 05:41
  • Did you try `ClickInput()` instead? or running as Administrator? – Vasily Ryabov Apr 25 '16 at 08:42
  • I am getting the following error & yes I am running it as an administrator: window.Install.ClickInput() File "C:\Python27\lib\site-packages\pywinauto-0.5.4-py2.7.egg\pywinauto\controls\HwndWrapper.py", line 900, in ClickIn put self, button, coords, double, wheel_dist = wheel_dist, use_log = use_log, pressed = pressed, absolute = absolute) File "C:\Python27\lib\site-packages\pywinauto-0.5.4-py2.7.egg\pywinauto\controls\HwndWrapper.py", line 1778, in _perfo rm_click_input win32api.SetCursorPos((coords[0], coords[1])) pywintypes.error: (0, 'SetCursorPos', 'No error message is available') – Rahul V Apr 25 '16 at 09:49
  • It means that UAC is enabled. You need to disable UAC to zero level to be able to automate the task. – Vasily Ryabov Apr 25 '16 at 10:10
  • UAC is already at zero level. I am running the code in Windows Server 2012 64bit – Rahul V Apr 25 '16 at 10:16
  • and 64-bit Python? – Vasily Ryabov Apr 25 '16 at 10:45
  • It looks like RazerX has the same problem: http://stackoverflow.com/questions/36835890/installing-unsigned-drivers – Vasily Ryabov Apr 25 '16 at 10:53
  • It looks the problem is not on pywinauto side. But you can try one more workaround: use something like `app.WindowsSecurity.TypeKeys('{LEFT}{ENTER}')` to press `Install`. – Vasily Ryabov Apr 25 '16 at 10:58
  • yes 64 bit python.. yes i am also facing the exact prob..i want to put this in a script which is installing some components – Rahul V Apr 25 '16 at 10:59
  • app.WindowsSecurity.TypeKeys('{LEFT}{ENTER}') tried this.. this is also not working – Rahul V Apr 25 '16 at 11:16
  • OK, try to `Disable driver signature enforcement` ([instruction for WinServer2012](https://blogs.msdn.microsoft.com/emberger/2014/04/21/windows-server-2012-r2-install-unsigned-drivers/)). – Vasily Ryabov Apr 25 '16 at 11:18
  • for my scenario this thing will not work... as the script will run on different different environment... and plus i tried this.. it not working.. ! have to find a way to click on install button only – Rahul V Apr 25 '16 at 13:23

0 Answers0