cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use a custom property on my main form

1222tmiller
Occasional Contributor

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?



-
Tom Miller
PIDI
Software Development Manager
3 REPLIES 3

RE: How do I use a custom property on my main form

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.



Best regards,
Alexey

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
1222tmiller
Occasional Contributor

RE: How do I use a custom property on my main form

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.



begin

  if TfrmPidiLogin.Execute then begin

    Application.Initialize;

    Application.ShowMainForm := False;

    Application.CreateForm(TfrmMainClientGui, frmMainClientGui);

    Application.Run;

  end;

end.



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;

begin

  TestedApps.DEMO.Run(1, true);

  demo := Aliases.DEMO;

  tfrmPidiLogin := aclu.frmPidiLogin;

  rzMaskEdit := tfrmPidiLogin.pnlUserPass.edtPassword;

  rzMaskEdit.Click(18, 12);

  rzMaskEdit.Keys('xxyyzz');

  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);

  demo.frmMainClientGui.MainMenu.Click('[0]|[0]');

  demo.TMessageForm.Yes.ClickButton;

end;
-
Tom Miller
PIDI
Software Development Manager
1222tmiller
Occasional Contributor

RE: How do I use a custom property on my main form

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
-
Tom Miller
PIDI
Software Development Manager
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors