imrags has asked for the wisdom of the Perl Monks concerning the following question:

Hi
I am using Win32::GUITest module with Win32::IEAutomation...
I try to access a local website...and it pops up a Windows' Login box...to authenticate my login credentials.
I went through http://www.perlmonks.org/?node_id=650373 but the problem is the code works only after I close the Login Window...
I'm unable to set foreground to the particular window
my $searchString = 'Connecting to'; for (FindWindowLike()) { my $title = GetWindowText($_); next unless ( $title ); if( $title =~ /^$searchString/i ) { print "$title\n"; # SetForegroundWindow($windows[0]); SendKeys('$username'); SendKeys("{TAB}"); SendKeys("$pass"); SendKeys("{ENTER}"); } }
Since the code works after I close the window, I've no way of knowing the name of the "Login" window...
Is there a way to do it?
Last time, i did it was for a "SaveFile" window which was easier to implement...
Raghu

Replies are listed 'Best First'.
Re: Window name from IE
by matze77 (Friar) on Dec 16, 2008 at 10:27 UTC

    Maybe a search for "focus window" could help, thats another term for the currently active "foregrounded" window ...

    /nitpick @OP:
    http://www.perlmonks.org/?node_id=650373
    How To Read Win32 Window Title Text
    You could use id-tags here (or use html-tags) see:
    Linking on PerlMonks

    hth MH