Forum Discussion

kevinkleint's avatar
kevinkleint
Contributor
12 years ago

Detecting New Objects

Hi .... please forgive me if this is a completely novice question.



We want to be able to run a test that checks a panel (AfxWnd100 or wndAfx) for new objects. Is there a certain technique that works? Can we do this through a regular keyword test, or does it have to be scripted?



Thank you,



Kevin Kleint

  • Hi Kevin,


     


    As the class name of this window may change from run to run, you need to enable the Auto-correct Afx window class names option in TestComplete. Refer to the "Engines - General Options" article for more information.


     

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Kevin,


     


    As the class name of this window may change from run to run, you need to enable the Auto-correct Afx window class names option in TestComplete. Refer to the "Engines - General Options" article for more information.


     

  • That's some great information, however it doesn't necessarily answer my question. If I have a control ... like a tab control. And each time I test it, I want the test to verify if there have been any controls added/deleted from the tab control. How would I do that?



    Kevin
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Kevin,


     


    To clarify: do you want to check whether the target control is displayed on the tab panel?


     

  • What I want to be able to do is test to see if there is a change in the NUMBER of controls on the tab panel. The application that we test goes through many upgrades/change packages each year. Controls can be added (or taken away) and I want to be notified when this happens.



    For example, if we have 2 text boxes on the tab panel ... I want to check to see if any controls were added or deleted. Are there now 3 controls? Did they take away 1?



    Thanks
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Kevin,


     


    You can check the value of the ChildCount property of the window - it returns the number of children the window has.


    Or, you can use the FindAllChildren method to find all text boxes on the target window and get its count.