Can't access element in PyWinAuto using child_window()

62 Views Asked by At

I have a third party application wherein I am trying to automate clicking of a button. First, I accessed all elements using print_control_identifiers() as follows:

from pywinauto.application import Application

app = Application(backend='uia').start('selfService.exe').connect(backend = 'uia', title = 'Citrix Workspace', timeout = 50)

The tree that I got was very large as I had put 'uia' in both functions.

I needed the 'User Menu' button which was found at a depth of 17.

  `|    |    |    |    |    |    |    |    |    |    |    |    |    |    |    | Button - 'User menu'    (L1423, T185, R1463, B226)`
   `|    |    |    |    |    |    |    |    |    |    |    |    |    |    |    | ['User menuButton', 'Button5', 'User menu']`
   `|    |    |    |    |    |    |    |    |    |    |    |    |    |    |    | child_window(title="User menu", auto_id="id0.19596181806763968", control_type="Button")`

However, when I use an object wrapper on that element and send the click_input() function, I get an pywinauto.findwindows.ElementNotFoundError error.

Pls help in what I should do to be able to access that button

Expected button to be clicked, instead element was not found.

0

There are 0 best solutions below