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.
You can check to see if there's a specific hotkey to close the program. However, the easiest way to do this is to send Alt-F4.
Bases: pywinauto.base_wrapper.BaseWrapper. Default wrapper for User Interface Automation (UIA) controls. All other UIA wrappers are derived from this. This class wraps a lot of functionality of underlying UIA features for working with windows. Most of the methods apply to every single element type.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With