0
votes

I am trying to write an automation script that involves interacting with windows that have titles that change based on the user-set search parameters. In line 4 and 5 of the sample code they use app.UntitledNotepad but what if my script saves the file and then the window title is changed. Is there any other way to interact with application windows besides this handle?

(1)   >>> from pywinauto import application
(2)   >>> app = application.Application()
(3)   >>> app.start("Notepad.exe")
      <pywinauto.application.Application object at 0x00AE0990>
(4)   >>> app.UntitledNotepad.draw_outline()
(5)   >>> app.UntitledNotepad.menu_select("Edit -> Replace")

In my code I have:

app_log = Application(backend="uia").connect(process=appcheck.get_window_pid('Login'), timeout=10)

So, even though I can "connect" to this login window I still can't interact with it unless I write app_log.Login.child_window(