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

Reading content of widget

Expand Messages
  • Gabor Szabo
    I am new here and the question obviously shows my lack of RTFM and lack of understanding of the Windowing world, please bear with me. I am trying to test
    Message 1 of 2 , Feb 27, 2004
    • 0 Attachment
      I am new here and the question obviously shows my lack of RTFM and lack of
      understanding of the Windowing world, please bear with me.

      I am trying to test calc.exe (OK, I am trying to learn Win32::GuiTest
      and this is the example I use).

      It works nicely so far I can push the buttons but how
      can I check the results of the calculation ?


      I have an untested work around:
      - Copy/Paste the results to notebook
      - save it and
      - open the file by Perl
      but somehow it does not feel right to use such a work around in
      the general case :-)


      Probably I could do something with OLE automation too but that again
      does not make sense (to me) in the general case.



      Can someone please point me to the right RTFM about reading
      Here is the script so far:


      use Win32::GuiTest qw(
      FindWindowLike
      GetWindowText
      PushButton
      SendKeys
      GetChildWindows
      GetListContents
      );

      $Win32::GuiTest::debug = 0;

      system "start calc.exe";
      sleep(1);
      my @windows = FindWindowLike(undef, "Calculator");
      PushButton '3';
      #sleep(1);
      PushButton '\*';
      #sleep(1);
      PushButton '7';
      #sleep(1);
      PushButton '=';
      #sleep(1);

      # how can I check the results ?

      # and then close the window...

      SendKeys("%{F4}");
    • Dennis K. Paulsen
      Gabor, You ll most likely want to use WMGetText() on the widget that contains the digits. Regards, D ... lack of ... Win32::GuiTest ... again
      Message 2 of 2 , Mar 17, 2004
      • 0 Attachment
        Gabor,

        You'll most likely want to use WMGetText() on the widget that
        contains the digits.


        Regards,
        D
        --- In perlguitest@yahoogroups.com, Gabor Szabo <gabor@p...> wrote:
        >
        > I am new here and the question obviously shows my lack of RTFM and
        lack of
        > understanding of the Windowing world, please bear with me.
        >
        > I am trying to test calc.exe (OK, I am trying to learn
        Win32::GuiTest
        > and this is the example I use).
        >
        > It works nicely so far I can push the buttons but how
        > can I check the results of the calculation ?
        >
        >
        > I have an untested work around:
        > - Copy/Paste the results to notebook
        > - save it and
        > - open the file by Perl
        > but somehow it does not feel right to use such a work around in
        > the general case :-)
        >
        >
        > Probably I could do something with OLE automation too but that
        again
        > does not make sense (to me) in the general case.
        >
        >
        >
        > Can someone please point me to the right RTFM about reading
        > Here is the script so far:
        >
        >
        > use Win32::GuiTest qw(
        > FindWindowLike
        > GetWindowText
        > PushButton
        > SendKeys
        > GetChildWindows
        > GetListContents
        > );
        >
        > $Win32::GuiTest::debug = 0;
        >
        > system "start calc.exe";
        > sleep(1);
        > my @windows = FindWindowLike(undef, "Calculator");
        > PushButton '3';
        > #sleep(1);
        > PushButton '\*';
        > #sleep(1);
        > PushButton '7';
        > #sleep(1);
        > PushButton '=';
        > #sleep(1);
        >
        > # how can I check the results ?
        >
        > # and then close the window...
        >
        > SendKeys("%{F4}");
      Your message has been successfully submitted and would be delivered to recipients shortly.