I am new to using PyWinAuto and I'm trying to automate a application without any developer support material. Apologies if I'm not using the right words to explain my issue or if I'm asking a noob question.
I need to be able to use a variable within my control identifiers.
from pywinauto.application import Application
from pywinauto import Desktop
import time
'''
This script assumes that RMS is already open and logged into and is at the Home Screen
'''
#Connect to Open Application
app = Application(backend='uia').connect(title='RMS - Resident Management System (Patch: 0495) Highest Possible Classification is CUI', timeout=20)
app.RMSResidentManagementSystemPatchHighestPossibleClassificationisCUI.set_focus()
#THIS WORKS
app.RMSResidentManagementSystemPatchHighestPossibleClassificationisCUI.G5000358.click_input(button='left', double=True)
#I NEED SOMETHING LIKE THIS TO WORK
STRINGVARIABLE = 'G5000358'
app.RMSResidentManagementSystemPatchHighestPossibleClassificationisCUI.STRINGVARIABLE.click_input(button='left', double=True)
This is the thing I'm trying to double click on. If there's a better way to go about doing that, please let me know.
| | | | | | Static - 'G5000358' (L487, T356, R627, B372)
| | | | | | ['Static20', 'G5000358', 'G5000358Static']
| | | | | | child_window(title="G5000358", auto_id="CellElement_0_0", control_type="Text")
I figured it out (or I stumbled upon something that seems to work).
RMSDistNumb = 'G5000358'
app.RMSResidentManagementSystemPatchHighestPossibleClassificationisCUI.child_window(title=RMSDistNumb, control_type="Text").click_input(button='left', double=True)