Forum Discussion

seanfitzg's avatar
seanfitzg
New Contributor
15 years ago

Name Mapping producing nonsense WndClass and MappedName values

Hi,



We've been using TestComplete for a number of years.  But since version 7, we've been having a problem with the NameMapping function.  For some reason TestComplete reads the FullName value in our vb.net WinForms application incorrectly.  When we recorded the scripts we got, for example:



Set irsfr01648 = mdiClient.IRSFR01648



But recently, this same action is recording as:

Set irsfr01648 = pulse.wndWindowsForms10Window8app0378734a4.WindowsForms10MDICLIENTapp0378734a.wndWindowsForms10Window8app0378734a



Also, in the object browser, the FullName is sometimes:

Sys.Process("PULSE").WinFormsObject("PULSEMdi").WinFormsObject("MdiClient", "").WinFormsObject("IRSFR01648")



And the WndClass value is:

WindowsForms10.Window.8.app.0.378734a



Whereas other times the WndClass value is mdiClient.IRSFR01648 - this is the correct value.



For this reason, in most cases our newer scripts fail to run because of the nonsense values in the MappedName and WndClass properties.



Our older scripts all run correctly, because they use the WinFormsObject("xxx") format.



Has anyone seen this behaviour in TestComplete?  Also, how does one set up TestComplete to record scripts using the older WinFormsObject("xxx") format?


9 Replies

  • seanfitzg's avatar
    seanfitzg
    New Contributor
    I should mention that this appears to occur for all VB.Net winform applications that I create.



    In essence, it means TestComplete 7.x is unusable for all Winform apps scripted using Name Mapping.

  • Hi Sean,


    The behavior you are observing is caused by the fact that the .NET application is not recognized as Open by TestComplete. First of all, please make sure that the .NET Open Application Support plug-in is installed and enabled in TestComplete ("File | Install Extension..."). If this suggestion does not help you solve the problem, we need some additional information to investigate the issue. Please answer the questions below:


    1. 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 (the application's main window may become blank or unresponsive in such cases). If so, try increasing the Method invoke timeout option described in the Project Properties - General Open Applications Options help topic, check whether the problem persists and let us know your results.


    2. What version of TestComplete are you using (Help | About...)? If it is earlier than TestComplete 7.20 (the latest version of TestComplete 7), please update the tool and check whether the problem persists in this version.


    3. Is your tested application compiled for an x86 or for an x64 platform?


    4. Exactly how is the application launched? Is it launched as an item of the Tested Applications collection? Is it launched under another account (in RunAs mode)? Is it launched before or after TestComplete is launched? Please send us a detailed description of the steps you follow to launch the application.


    5. Is the application launched from a network folder or from a folder having specific Runtime Security Policy settings? If it is, please make sure that the Runtime Security Policy settings for the folder from which the application is started are set as it is described in the Working With Network and No-Touch-.NET-Deployment Applications help topic.


    6. Is the application treated as Open according to the Process Filter options? Please see the Project Properties - Process Filter Options help topic for details.


    7. The problem can be caused by an abnormal termination of TestComplete and the lack of subsequent restarting of the tested application. Is this your case?


    8. Does the tested application in question use a non-standard controls library (WPF, VCL.NET, etc.)?


    9. Do you see AppDomain(...) objects in the application's process when the application is not recognized as Open?

  • rmoore_1's avatar
    rmoore_1
    New Contributor

    Hi,





    I am having a similiar issue with NameMapping when recording tests. Everything was working as intended when recording scripts, 

    but for some reason now it maps objects such as a form as WindowsForms10.Window.8.app.0.378734a which used to map to an 

    object named frmMain. The .NET Open Application Support plug-in is installed. Here is some additional information:





    1. Increased the Method Invoke timeout from 3000 to 6000. This had no effect.





    2. I am using TestComplete 7.52.678.7





    3. The tested application is compiled for a 32-bit (x86 platform)





    4. The tested application is launched after TestComplete is launched. It's not run under a different account. In the script, I 

        use the line: Call TestedApps.AppName.Run()







    5. The application under test is located on the local machine.





    6. In the Process Filter, the filter mode is set as Use only tested applications and the application's process is listed under the process       list.





    7. There is no abnormal termination of TestComplete or restarting of the tested application.





    8. The application under test uses standard .NET controls.





    9. In the object browser, I do not see AppDomain(...) objects, however, I believe that the application is recognized as an open           application.
  • I experienced the same problem.



    My computer autoinstalled the Microsoft .NET Framework 3.5 SP1 and .NET Framework 2.0 SP2 Update for Windows Server 2003 and Windows XP x86 (KB982524) and my name mapping changed



    It used to be:



    Sys.Process("BackupRestore").WinFormsObject("frmBackRest")



    Now it's



    Sys.Process("BackupRestore").Window("WindowsForms10.Window.8.app.0.378734a", "Backup/Restore", 1)



    How do I fix this issue?



    Thanks.
  • Since last night's Windows update, I'm experiencing the problem as well. The tested application doesn't seem to be recognised as an Open Application anymore.



    Does anyone have more info on this problem?



    Thanks,

    Marius
  • rmoore_1's avatar
    rmoore_1
    New Contributor
    On one machine I was experiencing problems with, I removed KB976576 and KB980773 and was able to run the tests.
  • Hi Everybody,



    We are aware of the problem that occurs after installing updates for .NET Framework 2.0 and 3.5 in TestComplete 7.52, and we have a patch that should solve it. Contact our Support Team via our Contact Support form to get the patch.
  • Hi,



    Till lask week Tool Bar of the application was idenfied as

    Form["StripMainMenu"]



    but now the Object is identified  as WindowsForms10.Window.8.app.0.378734a and This is the Problem in identifying the Tool Bar only where as the other Objects are identified perfectly fine . I am using 7.52.678.7. I have replaced the tcClrHook.dll as well. But nothing is happening. Kindly help me in resolving the Issue.



    Regards,

    Abdul

  • Anonymous's avatar
    Anonymous

    Hi Abdul,





    Could you please post a screenshot of the Object Browser demonstrating how TestComplete recognizes your application here?