I'm trying to automate a windows application using pywinauto. I can select the menu and open the "open file window". I need to wait for this window to appear and then set focus to that window and click some buttons.
For some reason is not working.
def open_file():
return pywinauto.findwindows.find_windows(best_match=u'Open File', class_name='#32770')[0]
pywinauto.timings.WaitUntilPasses(20, 0.5,open_file)
print('wait for window')
open_file.SetFocus()
When I try to run this it says that open_file doesn't have a SetFocus option.
I'm a beginner in pywinauto and I'm pretty sure that this is something easy to fix but I don't know how :/