8

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.

IordanouGiannis
  • 4,149
  • 16
  • 65
  • 99

2 Answers2

4

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

Vasily Ryabov
  • 9,386
  • 6
  • 25
  • 78
LittlePanda
  • 2,496
  • 1
  • 21
  • 33
0

You can find what available in app by executing print_control_identifiers(). Try this code :

app.print_control_identifiers()
bagus prasojo
  • 595
  • 5
  • 18