Forum Discussion

avalesano's avatar
avalesano
Occasional Contributor
12 years ago

Strange problem with .NET form being recognized as Window rather than WinFormsObject

The C# application I am testing starts at a login screen where the user enters their username/password, and then clicks OK to access the main form.  This login form is recognized by TC in the object browser as a .NET WinFormsObject.







However, for some reason TC is not able to recognize the main form once the user logs in. It shows up in the Object Browser as Window("WindowsForms10.Window.8.app.0.202c666", {form caption}, 1"), and TC cannot access its properties (such as the control name) which causes my test to fail.







Strangely enough though, if I close TestComplete at this point and reopen it while my AUT is still running with the user logged in and the main form showing, TC will correctly recognize the form as WinFormsObject("MenuForm") and everything works fine.







Can anyone shed some light on why this is happening or what I need to do so that TC is able to correctly recognize the window the first time without a restart?



Thanks!





5 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Anthony,


     


    A possible cause of the problem is that some complex actions which take long to be completed are performed in the application's GUI threads when the application is started. Try increasing the Method invoke timeout option and check whether the problem persists.


     

  • avalesano's avatar
    avalesano
    Occasional Contributor
    There is a small delay between clicking the OK button and when the main form is displayed, but increasing the Method Invoke Timeout doesn't seem to have any effect.  I tried changing it in both the Current Project Properties and Default Project Properties using values ranging from 3000 to 100000, but the same problem occurred every time.
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Anthony,


     


    That's a pity. Usually, 'Method invoke timeout' helps in this situation. Please answer the following questions:


    1. Does refreshing the "Integra" process help?


    2. What TestComplete version are you using? Try TestComplete 9.10 - the latest product version.


    3. Which versions of .NET Framework are installed on your machine? What is the version of your <Windows>\System32\mscoree.dll file (you can find that out via the file's properties)?


    4. Which .NET Framework version is used by your app?


     

  • avalesano's avatar
    avalesano
    Occasional Contributor

    1. Refreshing doesn't help.  I can see properties like HandleCount and MemUsage changing, but the app is still shown as a non-open Window object.


     


    2. I am running version 9.10.1894.7 in trial mode.


     


    3. I have these versions of the .NET Framework installed:



    • v2.0.50727  2.0.50727.5420  SP2


    • v3.0  3.0.30729.5420  SP2


    • v3.5  3.5.30729.5420  SP1


    • v4 Client  4.5.50709


    • v4 Full  4.5.50709


    • v4.0 Client  4.0.0.0



    C:\Windows\System32\mscoree.dll version is  4.0.40305.0


     


    4. I'm not 100% sure, but I believe the app is targeting .NET v3.5 - CLR v2.0.50727

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Anthony,


     


    Could you please check whether the problem persists in TestComplete 9.20?