Forum Discussion

1222tmiller's avatar
Occasional Contributor
15 years ago

How do I use a custom property on my main form

Delphi 2007, Windows 7, Test Complete 7

My first test I am trying to write is for the login screen.  Want to test some different scenarios.  Once the main form is shown, the system goes off and does a lot of stuff.  I need for the test script to wait for all the initialization stuff to complete before closing the window. 

We have some things that run in OnShow and a custom AfterShow event.  So I added a property InitializationComplete.

So I tried to add a wait based on MainForm.InitializationComplete = true. 

It errors out as not being able to find the new property.  Every attempt to use the wizard to find the main form object so I can select the custom property InitializationComplete fails.

Any one have any suggestion?

3 Replies

  • Hi Tom,

    Please compile the application as it is described in the "Using Debug Info Agent With Delphi Applications" help topic - this should make the property available for TestComplete.

  • 1222tmiller's avatar
    Occasional Contributor
    Still not working the way I need it too.  Made some progress

    We create the Login screen and then create the application once we get a good response from the login screen.


      if TfrmPidiLogin.Execute then begin


        Application.ShowMainForm := False;

        Application.CreateForm(TfrmMainClientGui, frmMainClientGui);




    So what I want to do is show the login screen, fill in the appropriate info, try to login, wait until IsConnected is = true.

    Even though the WaitProperty is the last line for the login screen object, it runs first.  So nothing happens.

    If I take this line out, for some reason the next line works fine, even though there is no create page step.  It doesn't respond to the "True" happening, so do I need to wrap it around a while?  What would the syntax for that be?

    procedure Login_NormalLogin;

      var demo : OleVariant;

      var tfrmPidiLogin : OleVariant;

      var rzMaskEdit : OleVariant;


      TestedApps.DEMO.Run(1, true);

      demo := Aliases.DEMO;

      tfrmPidiLogin := aclu.frmPidiLogin;

      rzMaskEdit := tfrmPidiLogin.pnlUserPass.edtPassword;

      rzMaskEdit.Click(18, 12);


      tfrmPidiLogin.pnlButtons.btnConnect.Click(50, 7);

      // Make sure the connection has been completed

      tfrmPidiLogin.WaitProperty('IsConnected', true, 30000);

      // Make sure the initialization process of passing data between

      // the program and the middle tier has completed.

      demo.frmMainClientGui.WaitProperty('IsInitialized', true, 50000);



  • 1222tmiller's avatar
    Occasional Contributor
    This is what finally worked. 

      while aclu.frmMainClientGui.Exists = false do

        aqUtils.Delay(2000); // 1 sec delay}


      while aclu.frmMainClientGui.atDonorDirectInitialized = false do

        aqUtils.Delay(1000); // 1 sec delay