Forum Discussion

eliaralva's avatar
eliaralva
Occasional Contributor
14 years ago

Cannot access method in Delphi App

Hello, I'm new in TestComplete7. I'm not being able to access to a new method I created in a delphi app. I cannot see it from Object Browser Methods (see image attached). What Should I do to make this simple method accesible from TestComplete?


Here is the delphi app:



type

  TForm1 = class(TForm)

  private

    { Private declarations }

  public

    { Public declarations }

    procedure ShowTest;

  end;


var

  Form1: TForm1;


implementation


{$R *.DFM}


{ TForm1 }

procedure TForm1.ShowTest;

begin

  ShowMessage('This is a test for TestComplete7');

end;


Thanks for your help.



Elia.

1 Reply


  • Hi Elia,





    First of all, you must compile your application with debug information as it is described in the help topic corresponding to your version of Delphi. You can find the list of these topics in the Open Applications in Delphi help topic.





    Also, please note that the Delphi compiler removes methods that are not called within the source code from a binary file. To avoid this, you need either to call your 'ShowTest' method anywhere within the application or declare it as a 'published' method:

    type

      TForm1 = class(TForm)

      private

        { Private declarations }

      public

        { Public declarations }

      published

        procedure ShowTest;

      end;