Forum Discussion

nlazouzi's avatar
nlazouzi
Contributor
14 years ago

Vote Yes or No to have the OBJECT SPY TOOL added to TestExecute !

Good morning everyone !



In the past few months, i've enountered different scenarios where during a test,  a failure due to a window object of some sort would occur and troubleshooting this would require recreation of the same issue on the host that has TestComplete installed on it (The main controller) so that i can access the object spy tool . This is ok if the issue is a simple one and access to the window object is not so difficult.



However, in some instances, as the test grows and the failures start to show after a complicated number of configurations have taken place (especially in a multiserver environment) recreatuing this becomes a nightmare. 



To avoid this headache i proposed to AUTOMATEDQA to add the object spy to TestExecute. That way it's available right where the problem occurs and object verification can take place immediately on the problematic host without having to go  additional steps to recreate the issue.



I assume i'm not the only one that has encountered this problem and truly believe that the addition of the object spy to TestExecute would have tremendous benefits.



Please take 1 minute to respond with a

YES(i agree. The object spy would be good to have on the slave hosts)  

or

NO (i disagree. No need for the object spy on the slave hosts)



You don't have to explain unless you want to.    a YES or NO answer would be more than enough.



Thank you.

5 Replies


  • Hi Nabil,





    As TestExecute's goal is only test execution, you should use TestComplete to create or debug your tests.
  • nln's avatar
    nln
    New Contributor
    Hello,



    I would really like to enforce Nabils request here!

    I totally agree, it is a headache when trying to debug scripts running on clients, especially when the client has a different OS, where the objects may look different from what they look on the test developer machine.

    So, for me either a stand-alone object spy or some kind of remote debugging functionality, so you can attach to the test execution from TestComplete, would be of a lot of help.



    Thanks!



    /Niklas

  • Hi Ory and Niklas,





    I think, I should let you know some of the points we've given Nabil during our e-mail conversation. 





    If you own a Floating User License of TestComplete, you can install the tool on all the machines where debugging is needed and run the tool only on those machines where you actually debug your tests. Thus, most probably, it will be enough to launch only one instance of the tool at a time, so only one TestComplete license will be used. In other words, you won't need to use extra TestComplete licenses to debug your tests.





    Also, here is a quotation of our first e-mail message we set to Nabil:

    Unfortunately, we do not plan to add this feature to TestExecute. As the purpose of Object Spy is to collect data needed for creating or modifying tests, this feature is included only in a tool that can create and edit tests, that is, TestComplete.
  • i have the same problem to evaluate the windows classname and caption out of a virtual machine from a operation system we have not installed on a computer where test complete can be run.



    so i wrote a little tool in delphi for my own need. hope will help you too.





    the form hast simply a tmemo control and a timer.



    the source code :








    unit Unit1;





    interface





    uses

      Windows, Classes, Graphics, Forms, StdCtrls, SysUtils, ExtCtrls, Controls, Dialogs,

      Buttons, Menus, ComCtrls, DB;









    type

      TForm1 = class(TForm)

        Timer1: TTimer;

        Memo1: TMemo;

        procedure FormCreate(Sender: TObject);

        procedure Timer1Timer(Sender: TObject);

      private

         pold : TPoint;

      private

        function ToTheTop(cwin: THandle): string;

      end;





    var

      Form1: TForm1;





    implementation





    {$R *.dfm}









    function GetWinCaption(Handle: THandle): string;

    var

      Len: LongInt;

      Title: string;

    begin

      Result := '';

      if Handle = 0 then Exit;

      Len := GetWindowTextLength(Handle) + 1;

      SetLength(Title, Len);

      GetWindowText(Handle, PChar(Title), Len);

      Result := TrimRight(Title);

    end;





    function GetWinClassName(Handle: THandle): string;

    var

      aName: array[0..255] of char;

    begin

      Result := '';

      if Boolean(GetClassName(Handle, aName, 256)) then

        Result := aName

      else

        Result := '<none>';

    end;





    function TForm1.ToTheTop(cwin: THandle): string;

    var wwnd: THandle;

        clsName, winCaption: string;

    begin

      Result := '';





      while cwin <> 0 do

      begin

        clsName := GetWinClassName(wwnd);

        winCaption := GetWinCaption(wwnd);





        Result := clsName + '("' +winCaption +'").' + Result ;





        wwnd := GetParent(cwin);

        if wwnd = 0 then break;

        cwin := wwnd;

      end;

    end;





    procedure TForm1.Timer1Timer(Sender: TObject);

    var

       p             : TPoint;

       x,y  : Integer;

       h, h1    : Thandle;





    begin

       Application.ProcessMessages;

       GetCursorPos(p);

       x := p.x;

       y := p.y;





       if (pold.x = x) and (pold.y = y) then Exit;

       pold.x := x;

       pold.y := y;





       h := WindowFromPoint(p);

       h1 := ChildWindowFromPoint(h,p);

       If h1 <> 0 then

          h := h1;





       memo1.Clear;

       memo1.Lines.Add('Handle :  ' + IntToStr(h));

       memo1.Lines.Add('Name: '+ToTheTop(h));

    end;





    procedure TForm1.FormCreate(Sender: TObject);

    begin

      FormStyle := fsStayOnTop;





      pold.X := -1;

      pold.Y := -1;





      Timer1.Interval := 250;

      Timer1.Enabled := True;

    end;





    end.


    [\code]