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

Using Gui TEST with Foxpro.

Expand Messages
  • talwyn
    Has anyone had any experience using GUITest with Foxpro Applications? I d be interested in hearing your experiences. Some of these apps use foxpro classes and
    Message 1 of 1 , Nov 14, 2003
    • 0 Attachment
      Has anyone had any experience using GUITest with Foxpro Applications?
      I'd be interested in hearing your experiences. Some of these apps use
      foxpro classes and others use Active X. The method I used to find
      all the controlls doesnot seem able to look inside these entities.

      How do I expose their buttons or other features so that I can
      activate them from a test script?

      Script and output I used are posted below:


      Script
      ---------------------------------------------------------------
      use strict;
      use Win32::GUI @Win32::GUI::EXPORT_OK;
      use Win32::GuiTest @Win32::GuiTest::EXPORT_OK;
      use Data::Dumper;

      # Purpose Find Management and list all contents.
      $Win32::GuiTest::debug = 1;

      # Find StrataQA
      my @winHandle = FindWindowLike (undef,"Management");
      unless (@winHandle != 0 ) { "No Management Window Found!!!\n";}

      print "Found Management Window.\n";
      SetForegroundWindow ($winHandle[0]);

      # List Children
      my @winChildren = FindWindowLike ($winHandle[0]);
      print "There are ". @winChildren." children\n";



      #List Children's Children

      foreach my $hChild (@winChildren){
      print "For $hChild\n";
      my @hGchildren = FindWindowLike ($hChild);
      print "There are ". @hGchildren." children for $hChild)\n\n";

      }

      ---------------------------------------------
      Output

      Found Management Window.
      Window Found(Text : '' Class : 'stratamgm8c000000' Handle: '591244')
      Window Found(Text : '' Class : 'CtlFrameWork_ReflectWindow'
      Handle: '853406')
      Window Found(Text : '' Class : 'StatusBar20WndClass'
      Handle: '1181028')
      Window Found(Text : '' Class : 'AfxOleControl42' Handle: '1181024')
      Window Found(Text : '' Class : 'AfxWnd42' Handle: '1181016')
      There are 5 children
      For 591244
      Window Found(Text : '' Class : 'CtlFrameWork_ReflectWindow'
      Handle: '853406')
      Window Found(Text : '' Class : 'StatusBar20WndClass'
      Handle: '1181028')
      Window Found(Text : '' Class : 'AfxOleControl42' Handle: '1181024')
      Window Found(Text : '' Class : 'AfxWnd42' Handle: '1181016')
      There are 4 children for 591244)

      For 853406
      Window Found(Text : '' Class : 'StatusBar20WndClass'
      Handle: '1181028')
      There are 1 children for 853406)

      For 1181028
      There are 0 children for 1181028)

      For 1181024
      Window Found(Text : '' Class : 'AfxWnd42' Handle: '1181016')
      There are 1 children for 1181024)

      For 1181016
      There are 0 children for 1181016)
    Your message has been successfully submitted and would be delivered to recipients shortly.