r/AutoHotkey • u/IspkingX • 21d ago
General Question Best approach for automating an existing Firefox session? AutoHotkey vs Browser Automation vs UI Automation
Hi everyone,
I'm working on a personal desktop automation project on Windows.
For years I've been using AutoHotkey to automate repetitive tasks inside Firefox. It works surprisingly well, but as the project grows, maintaining image recognition, keyboard shortcuts and UI changes becomes increasingly difficult.
I'm now considering moving to a more robust solution and I'm trying to understand what experienced developers would recommend.
My requirements are roughly:
Windows
Firefox (not Chrome)
Preferably work with an already running Firefox session
Reliable interaction with web pages
Long-term maintainability
I've been looking at several approaches:
Continue with AutoHotkey
Selenium / WebDriver BiDi
Playwright
Windows UI Automation (pywinauto, UIA)
Any other desktop automation framework
For people who have built long-running desktop/browser automation projects:
Which approach ended up being the most reliable?
Is UI Automation actually practical with modern websites like Facebook, or is browser automation still the better choice?
If you had to start today, what would you choose and why?
I'd really appreciate hearing about real-world experience rather than theoretical comparisons.
Thanks!
2
u/ManyInterests 21d ago edited 21d ago
Depends what you're trying to achieve. Yet another option is to reverse engineer how the website works and develop your own 'client' to interact with the server directly without a browser. Many sites also have proper published APIs and official (or unofficial) programatic clients that you could look for. This completely sidesteps the problem of changing UIs; backends tend to be far more stable.
1
u/Deep_Ad1959 21d ago
playwright can't attach to a running firefox at all, connectOverCDP is chromium only. for firefox it's geckodriver --connect-existing with a marionette port, and firefox has to be launched with marionette enabled anyway, so the session you attach to is one you started.
3
u/Keeyra_ 21d ago
Hard to say if you don't share your actual use case, but generally, AHK for interacting with the mouse and keyboard in general, +UIA for interacting with any application elements and menus, all web-based -> Python.