I had a positive experience with Win32::GuiTest. If you want to go this way start by getting a handle to the window you are interested in. The manual shows this: my @found = FindWindowLike(0,"title-regex");. And the t/01_basic.t test script does it this way:
# Create a notepad window and check we can find it
system("cmd /c start notepad.exe \"README\"");
my @waitwin = WaitWindowLike(0, "readme|README", $class_re);
is(@waitwin, 1, "There is one notepad open with README in it");
my @windows = FindWindowLike(0, "readme|README", $class_re);
is(@windows, 1, "The same from FindWindowLike");
is($waitwin[0], $windows[0], "The two windows are the same");
# Find the edit window inside notepad
my $notepad = $windows[0];
my @edits = FindWindowLike($notepad, "", "Edit");
is(@edits, 1, "Edit window found within notepad");
I do not have any experience with the AutoIt3,that harangzsolt33 suggested, nor with AutoHotKey. I am sure they will do the job equally well. However, an all-Perl solution has benefits. The tricky part, recalling from my experience, is to wait for the windows to show and then make sure that the usual windows blabbering via popups will not get in the way of what window focus and arrangement you want.
|