Forum Discussion

jwm's avatar
jwm
Visitor
8 years ago

Application changes from WinFormsObject to Window

When running a test, after some time of normal operation, TestComplete will begin to see the application under test as a Window object instead of a WinFormsObject, and thus it loses access to the .NET properties it needs to run the test. This can be noticed in the object browser:
Normal:

 

 

Application has changed to Window:


The WorkFlowMainForm application is not actually changing - when it is in the abnormal state, restarting TestComplete and visiting the Object Browser again will result in the application again appearing as a WInFormsObject as expected. Refreshing the Object Browser isn't enough, only a restart will get it to recover.

 

What could be causing TestComplete to see the WinFormsObject as a Window?

 

I greatly appreciate any assistance!

 

It feels very similar to this issue, but this is obviously not something related to TestComplete 7 specifically: https://community.smartbear.com/t5/TestComplete-Functional-Web/Referrence-Changing-from-winforms-object-to-window-object/td-p/70224 

The test script was developed under TestComplete 10, the same behavior is observed when running it in TestComplete 10 and the latest TestComplete 12.

4 Replies

    • Marsha_R's avatar
      Marsha_R
      Champion Level 3

      We've seen this happen too.  Can't duplicate it, but it usually happens at the end of a day when we've had TC open all day, so we were blaming it on a TC memory leak.  It's happened for several versions now, but it's better in v11 than it was in v9.

       

      Wish I could give you steps to duplicate...

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Marsha_R has the right of it.  It's not something I've been able to nail down but we've seen this dating back to TestComplete versions 2 and 3.  The longer TC is open, the more controls it's working with, the more memory consumption until we get these kinds of strange behaviors. 

         

        Couple of things to try:

         

        1) If you have a license, try running your tests via TestExecute and see if the same behavior occurs.  TE has a smaller memory footprint as well as no need to keep up an IDE or debugging process so you might not see this problem.

        2) In my experience, while it is related to TestComplete and the hooks it puts into your AUT, the memory leak is actually more in those hooks than in the TC IDE/Engines.  Try breaking up your tests where you close down your application and re-open it at regular points to keep that memory consumption minimal.  

        3) Try breaking up your tests into multiple, smaller projects where you can run a smaller project for a shorter period of time.  You can then structure your test runs from command line to run those projects in sequence rather than a single large project or a large project suite.

         

        In the meantime, I'd open a support case with SmartBear to have them look into this. I know it's not easily reproduceable but, if you can describe what kind of application you're testing, what sort of code/controls you're using, etc., they can set up simulations or even give instructions on doing some profiling so they can determine the source of the leak.