Loading ...
Sorry, an error occurred while loading the content.
 

Re: FindWindowLike doesn't recognise my popup window?

Expand Messages
  • Tim Mitchell
    This happens to me often in my test scripts. It usually is because my script gets ahead of the application. It s a matter of timing. Try inserting a sleep
    Message 1 of 8 , Oct 11, 2006
      This happens to me often in my test scripts. It usually is because my
      script gets ahead of the application. It's a matter of timing. Try
      inserting a sleep command before the FindWindowLike line.

      Tim
      --- In perlguitest@yahoogroups.com, "maryshi_us" <maryshi_us@...> wrote:
      >
      > My code is
      >
      > my @win=FindWindowLike(0, "Agent Tool ");
      > die "No agent tool is running, please open one.\n" if not @win;
      > if(@win){
      > print "Tool is running\n" ;
      > }
      >
      > my $menu = GetMenu($win[0]);
      > my $submenu = GetSubMenu($menu, 0);
      > MenuSelect("&Tools|Check For &Updates", $win[0], $menu);
      > sleep(1);
      >
      > my @win_popup=FindWindowLike(0, "Update ");
      > die "Cannot get popup window.\n" if not@win_popup;
      > print "Popup window is running.\n" if @win_popup;
      > PushButton("&Cancel");
      >
      > it is failed because FindWindowLike cannot fine "Update", which is a
      > popup window. if ignore die "Cannot get popup window.\n" if @
      >
    • maryshi_us
      Thanks! ... child of ... etc.. ? They ... example, ... since its ... [mailto:perlguitest@yahoogroups.com] On ... window?
      Message 2 of 8 , Oct 11, 2006
        Thanks!
        --- In perlguitest@yahoogroups.com, "stuart arnold" <stuart.arnold@...>
        wrote:
        >
        > 1. if you do have the window of "Agent Tool", is the popup window a
        child of
        > it? if so, pass the $win[0] to that call to isolate it.
        > 2. is the popup window a Windows "window" and not a javascript,
        etc.. ? They
        > tend not to work very well.
        > (pls not "o" does not look too well as opposed to a "0" in your
        example,
        > just a complaint...)
        > 3. using (not @winpop), is probably better to use ($#winpopup < 0)
        since its
        > an array tellingh you # of elements.
        > 4. Have you tried "^Update" since this function uses regex?
        >
        > Hope some of this may help
        >
        > -----Original Message-----
        > From: perlguitest@yahoogroups.com
        [mailto:perlguitest@yahoogroups.com] On
        > Behalf Of maryshi_us
        > Sent: Tuesday, October 10, 2006 5:54 PM
        > To: perlguitest@yahoogroups.com
        > Subject: [perlguitest] FindWindowLike doesn't recognise my popup
        window?
        >
        >
        >
        > My code is
        >
        > my @win=FindWindowLike(0, "Agent Tool ");
        > die "No agent tool is running, please open one.\n" if not @win;
        > if(@win){
        > print "Tool is running\n" ;
        > }
        >
        > my $menu = GetMenu($win[0]);
        > my $submenu = GetSubMenu($menu, 0);
        > MenuSelect("&Tools|Check For &Updates", $win[0], $menu);
        > sleep(1);
        >
        > my @win_popup=FindWindowLike(0, "Update ");
        > die "Cannot get popup window.\n" if not@win_popup;
        > print "Popup window is running.\n" if @win_popup;
        > PushButton("&Cancel");
        >
        > it is failed because FindWindowLike cannot fine "Update", which is a
        > popup window. if ignore die "Cannot get popup window.\n" if @
        >
        >
        >
        >
        >
        >
        >
        > [Non-text portions of this message have been removed]
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.