python - Finding GUI elements with pywinauto -


i trying first things pywinauto. want make use of print_control_identifiers() errors, write code - cant information gui objects. tried generate code via swapy - had lot of generated code, no success.

this code far:

import getpass, fnmatch  pywinauto import application  currentuser = getpass.getuser()  if fnmatch.fnmatch(currentuser, "axe"):     pwa_app = application.application()     w_handle = application.findwindows.find_windows(title=u'login - 0.9.347', class_name='windowsforms10.window.8.app.0.141b42a_r11_ad1')[0]     window = pwa_app.window_(handle=w_handle)     window.setfocus()     ctrl = window['log in']     ctrl.click()   else:     print "you need admin rights action" 

can tell me, need use print_control_identifiers()? have other gui automation frameworks more up-to-date?

printcontrolidentifiers() useful top level window. if window top level window specification, call

window.printcontrolidentifiers() 

or

 pwa_app.window_(title=u'login - 0.9.347', top_level_only=true).printcontrolidentifiers() 

Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -