While trying to automate notepad GUI, I cannot make click function to work in a single try.
When I execute line 4 twice, the click ok button works and the "About Notepad" menu is closed. I tried doing the same with other buttons in other menus and it seems to work by clicking the button just once. What would be the reason for this particular dialog box/button not responding to the click function?
I am Windows 10 running Python 3.7.
from pywinauto.application import Application
app = Application().start("notepad.exe")
app.UntitledNotepad.menu_select("Help->About Notepad")
app.AboutNotepad.OK.click()
No errors are produced. There is no result when I execute the line 4 once, but it works fine when executed twice.
send_keys('{ENTER}')<\code> . You'll have to add
– BramMooij May 02 '20 at 14:45from pywinauto.keyboard import send_keys<\code>. It's not exactly a solution, but it did solve my problem. Clicking twice turned out to be unreliable, so it wasn't a real solution.