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

PushButton doesn't work with my code, would somebaby please help?

Expand Messages
  • maryshi_us
    I open notepad and write some text, then I use the following code to test use Win32::GuiTest qw(:ALL); my @win=FindWindowLike(0, Notepad ); die no notepad
    Message 1 of 3 , Oct 11, 2006
    • 0 Attachment
      I open notepad and write some text, then I use the following code to test

      use Win32::GuiTest qw(:ALL);

      my @win=FindWindowLike(0, "Notepad");
      die "no notepad" if not @win;
      print"found" if @win;

      my $menu = GetMenu($win[0]);
      my $submenu = GetSubMenu($menu, 0);

      MenuSelect("&File|E&xit", $win[0], $menu); sleep(1);
      PushButton("No");

      Expected result: popup window should be closed
      Actual result:popup window still shows up
      I try use "Cancel", but it comes with same result.
    • baiyang1
      I test your code, It s succeed to close notepad. Maybe your module version is not 1.50.5. ... to test
      Message 2 of 3 , Oct 12, 2006
      • 0 Attachment
        I test your code, It's succeed to close notepad.

        Maybe your module version is not 1.50.5.


        --- In perlguitest@yahoogroups.com, "maryshi_us" <maryshi_us@...>
        wrote:
        >
        > I open notepad and write some text, then I use the following code
        to test
        >
        > use Win32::GuiTest qw(:ALL);
        >
        > my @win=FindWindowLike(0, "Notepad");
        > die "no notepad" if not @win;
        > print"found" if @win;
        >
        > my $menu = GetMenu($win[0]);
        > my $submenu = GetSubMenu($menu, 0);
        >
        > MenuSelect("&File|E&xit", $win[0], $menu); sleep(1);
        > PushButton("No");
        >
        > Expected result: popup window should be closed
        > Actual result:popup window still shows up
        > I try use "Cancel", but it comes with same result.
        >
      • vidhut singh
        Hey buddy, Instead of using pushbutton y don t u go for PushChildButton(); Just pass the window handle and the control id of the button . It wll definetly work
        Message 3 of 3 , Oct 12, 2006
        • 0 Attachment
          Hey buddy,
          Instead of using pushbutton y don't u go for PushChildButton();
          Just pass the window handle and the control id of the button .
          It wll definetly work
          cheers
          vidhut

          baiyang1 <baiyang1@...> wrote:
          I test your code, It's succeed to close notepad.

          Maybe your module version is not 1.50.5.

          --- In perlguitest@yahoogroups.com, "maryshi_us" <maryshi_us@...>
          wrote:
          >
          > I open notepad and write some text, then I use the following code
          to test
          >
          > use Win32::GuiTest qw(:ALL);
          >
          > my @win=FindWindowLike(0, "Notepad");
          > die "no notepad" if not @win;
          > print"found" if @win;
          >
          > my $menu = GetMenu($win[0]);
          > my $submenu = GetSubMenu($menu, 0);
          >
          > MenuSelect("&File|E&xit", $win[0], $menu); sleep(1);
          > PushButton("No");
          >
          > Expected result: popup window should be closed
          > Actual result:popup window still shows up
          > I try use "Cancel", but it comes with same result.
          >








          ---------------------------------
          Find out what India is talking about on - Yahoo! Answers India
          Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW

          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.