How can i find available dialogs ,controls of an application in pywinauto?

GiannisIordanou picture GiannisIordanou · Nov 4, 2011 · Viewed 13.1k times · Source

I am using pywinauto in windows 7 and I am searching for a way to find the available dialogs and controls of an application.The following is an example:

from pywinauto import application
import time

app=application.Application()
app.connect_(title_re = ".*Notepad", class_name = "Notepad")

You can start or connect to an application with pywinauto.But I don't know how can I find whats available in notepad.Any ideas ? Thanks.

Answer

LittlePanda picture LittlePanda · Mar 30, 2015

This is working for me. Source: http://pywinauto.github.io/docs/getting_started.html

from pywinauto import application

app = application.Application.Start("Notepad.exe")
app.Notepad.print_control_identifiers()
app.Notepad.MenuSelect("Edit->Replace")
app.Replace.print_control_identifiers()

Or you can use Swapy to see all controls and class names

enter image description here