Pywinauto - 'event unable to invoke any of the subscribers'

144 Views Asked by At

I am attempting to automate a set of commands on an erp application and have run into an error that I don't know how to manage. After clicking on a specific button using a pywinauto command:

app.window(title='Epicor').child_window(auto_id='shortcutBar').child_window(title="Label Maintenance").click()

an error is thrown as such:

 _ctypes.COMError: (-2147220991, 'An event was unable to invoke any of the subscribers', (None, None, None, 0, None))

I am sure this error comes from invoking the .click() but can't tell why. Additionally, the window, 'Label Maintenance' does appear despite the program shutting down due to the error.

  1. I made sure the version of pywinauto I am using is functional with the version of python I'm using
  2. I increased the amount of time the program would run before timing out assuring that this error wasn't the cause of commands following the clicking of 'Label Maintenance'
  3. I have combed over the control identifiers for the window in which the 'Label Maintenance' exists and assured its location is the one I reference in the command.
1

There are 1 best solutions below

0
Vasily Ryabov On

Sometimes (I'd say pretty often :) ) the application doesn't implement proper handler code for .click() method, so you have to use .click_input() instead.

P.S. Some GUI elements may still be present but invisible in some destructor cases.