Reputation: 293
I have a script that runs several little programs I don't have the source code to, one of which requires filling out some fields in a GUI. I've been doing this by hand, but I'd like to have the Perl script focus the GUI window, then enter some hardcoded text into each field and close the window.
Upvotes: 1
Views: 262
Reputation: 16953
In the past I've used the Win32::GuiTest module for tasks like this. Have a look at the example scripts and documentation.
Upvotes: 4
Reputation: 124325
You might want to look into Win32::OLE. There's also a book on this topic.
Upvotes: 1
Reputation: 258358
Unless there's a specific reason you're using Perl, Autoit is a Basic-like scripting language pretty much specifically designed for automating GUI tasks. It's very easy to pick up.
You can have it wait for a window to become active, send any sequence of keystrokes or tell it to specifically focus on a GUI element with a given handle, and much more. You can also package the scripts as standalone executables, which can be a nice benefit when you need it.
Upvotes: 1