pywinauto TimeoutError at a very simlpe program in pycharm

36 views Asked by At

I just try to study the pywiauto library.

Here are the code copy from the pywiauto official website.

# Import pywinauto Application class
from pywinauto.application import Application

# Start a new process and specify a path to the text file
app = Application().start('notepad.exe', timeout=10)


# Main window specification
main_dlg = app.UntitledNotepad
main_dlg.wait('visible')

After I run the code in pycharm I got the below error:

E:\python\Pywinauto\.venv\Scripts\python.exe E:\python\Pywinauto\main.py 
Traceback (most recent call last):
  File "E:\python\Pywinauto\main.py", line 9, in <module>
    main_dlg.wait('visible')
  File "E:\python\Pywinauto\.venv\lib\site-packages\pywinauto\application.py", line 529, in wait
    wait_until(timeout, retry_interval,
  File "E:\python\Pywinauto\.venv\lib\site-packages\pywinauto\timings.py", line 375, in wait_until
    raise err
pywinauto.timings.TimeoutError: timed out

Process finished with exit code 1

line 9 is main_dlg = app.UntitledNotepad

I have checked many tutorial video, they don't have this error so I don't get any idea what is happen here.

0

There are 0 answers