If you need text properties based automation, pywinauto should help you. But there is no popular text-based cross-platform tool in Open Source field.
On macOs pyatom/ATOMac is good enough if you prefer Python (it requires some compilation during setup, but works well).
This is the big list of open source tools I'm maintaining.
- PyAutoGUI has image recognition capabilities (like Sikuli or Lackey) but it's not text based (even no Win32 API support).
- PyAutoIt bindings and AutoIt itself doesn't support MS UI Automation technology (only Win32 API).
- The Getting Started Guide for pywinauto explains some differences between these 2 technologies and how to switch between them in pywinauto.
Anyway this field is complicated and you may face many challenges. Feel free to ask more detailed questions because this question is more suitable for
Software Recommendations StackExchange site.
What is the difference between the two and which one is better?
(I'm using windows 10. )
Windows Desktop GUI Automation using Python - Sleep vs tight loop - Stack Overflow
automated testing - Are there GUI test tool better than Selenium? - Software Quality Assurance & Testing Stack Exchange
What are the differences of pyautogui, pywinauto, and swapy?
PyAutoGUI vs Pywinauto
Videos
For Windows only GUI automation pywinauto is a bit more full-featured (and pythonic). It waits some default time implicitly and allows explicit waiting (some CPU-non-intensive loop is inside: kind of 0.1 sec pause and quick check for changes, then waiting again).
PyAutoGUI locateOnScreen function uses advanced analysis of the screenshot. That is why it's so CPU intensive (but cross-platform).
pywinauto example:
from pywinauto import Application
app = Application(backend="win32").start(u'your_app.exe')
app.MainWindow.menu_select(u'File->Open')
app.OpenDialog.Edit.set_edit_text(u'some path')
app.OpenDialog.Open.click()
app.OpenDialog.wait_not('visible', timeout=10)
new_main_window = app.window(title_re='^.* - The Software$')
new_main_window.wait('ready', timeout=15)
Getting Started Guide is a good starting point for learning pywinauto core concept.
I think you can use pyautogui.getAllWindows(). This function returns all windows and their handles. so you can check when the new window has been added. for example:
windows = pyautogui.getAllWindows()
windows_count = len(windows)
while True:
current_windows = pyautogui.getAllWindows()
if len(current_windows) != windows_count:
break
Also, you can use the handle number of the desired window to activate the desired window and bring it to the foreground:
desired_window = pyautogui.Window(#enter window handle number)
desired_window.activate()
another way that I think is easier is pyautogui.getActiveWindowTitle(). This function returns the title of the active window. Maybe you can use that for break condition.
while True:
title=pyautogui.getActiveWindowTitle()
if title== "your desired window's title":
break
Do they all do different things? Do they work together to automate more complex really? Or are they all very similar just different brands of automation packages?
Can you list examples of the differences?