Goal: I'm trying to automate Canva.exe to create designs via GUI automation.
Specs: Spyder V5 (via anaconda) and Python 3.8 on Windows 11 Home OS
Problem: pywinauto is finding duplicate target values for the last 2 lines of my code (below) and giving me the error message (also included below).
import time
from pywinauto.application import Application
CanvaWin = Application(backend='uia').connect(title='Canva', timeout=100)
YP = CanvaWin.Canva.child_window(title="Your projects",control_type="Text").wrapper_object()
YP.click_input()
UP = CanvaWin.Canva.child_window(title="Uploader", control_type="Text").wrapper_object()
UP.click_input()
VT = CanvaWin.Canva.child_window(title="1 OF 2 More actions VideoTemplate Presentation", control_type="Button").wrapper_object()
VT.click_input()
time.sleep(10)
ETT = CanvaWin.Canva.child_window(title="enter title", control_type="Text").wrapper_object()
ETT.click_input()
Error Message:
ElementAmbiguousError: There are 2 elements that match the criteria {'title': 'enter title', 'control_type': 'Text', 'top_level_only': False, 'parent': <uia_element_info.UIAElementInfo - 'Canva', Chrome_WidgetWin_1, 198500>, 'backend': 'uia'}
What I have tried:
- Pywinauto documentation and help guides
- Started with a variety of google searches
- Checked other coding question forums (stack exchange, quora)