I recently tried to automate a windows application using a pywinauto since it enables automation with using python. I just started it and encountered a problem which hinders me to continue.
I get this error whenever I try to find the relevant element:
Traceback (most recent call last):
File "test.py", line 14, in <module>
app.findwindows.find_elements().click_input()
File "C:\Users\Bar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pywinauto\application.py", line 173, in __call__
format(self.criteria[-1]['best_match']))
AttributeError: WindowSpecification class has no 'find_elements' method
This is my code:
from pywinauto.application import Application
import pywinauto
import time
app = Application(backend='uia').start(r"C:\Program
Files\Intellech\Analyzer\Suite.exe")
time.sleep(3)
app.findwindows.find_windows(auto_id='btQuick').click_input()
Can you help me to find out the reason of this error?
findwindows
is a module name, not an attribute of Application
object. This is correct code for the last line:
app.window(title="Your Main Window").child_window(auto_id='btQuick').click_input()
where "Your Main Window"
should be changed to correct text of the top level window.