Forum Discussion

lleppert's avatar
lleppert
Contributor
10 years ago
Solved

Sporadic Namemapping Issues

Hello,

 

I have been having a namemapping issue with the last two tests that I have recorded. When I recorded them they were fine, but occasionally on playback it tells me that the object namemapping was not found. If I update it to match the similar object, or hit 'try again' it works but only for that run. The next time I play it usually fails(but not always). However, I am positive this is not a timing issue. I have 400 other tests that have been recorded almost identically, and none of them are having problems. To be sure, I added a 10 second delay after my application is launched. It passed for a day then failed again. I have checked and the object is mapped, the objects mapping does not ever change, and I have tried several different properties to identify it.

 

Any ideas?

 

Thank you!

Lauren

  • I've seen the same issue a lot on my system.  It seems that, for some reason, TestComplete occasionally loses the ability to see into open applications for a short time. But it is usually able to get it back, if you do a couple of things. I've been able to solve it by using a combination of things. First, you can use the General Open Applications property, specifically the Method Invoke Timeout property.

     

    I've also had success with the the WaitAliasChild method, and the Exists property, along with a RefreshMappingInfo call. It ends up looking like this:

     

    var w = Aliases.mySoftware.myForm.WaitAliasChild("myControl", 10000);

    if (!w.Exists) mySoftware.RefreshMappingInfo;

     

    Good luck!

6 Replies

  • rickh_28's avatar
    rickh_28
    Occasional Contributor

    I've seen the same issue a lot on my system.  It seems that, for some reason, TestComplete occasionally loses the ability to see into open applications for a short time. But it is usually able to get it back, if you do a couple of things. I've been able to solve it by using a combination of things. First, you can use the General Open Applications property, specifically the Method Invoke Timeout property.

     

    I've also had success with the the WaitAliasChild method, and the Exists property, along with a RefreshMappingInfo call. It ends up looking like this:

     

    var w = Aliases.mySoftware.myForm.WaitAliasChild("myControl", 10000);

    if (!w.Exists) mySoftware.RefreshMappingInfo;

     

    Good luck!

    • lleppert's avatar
      lleppert
      Contributor

      Thank you so much! The RefreshMappingInfo call seems to have done the trick.

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    Isn't name mapping fun?  :smileylol:

     

    A couple of things to try - 

     

    1) Check the mapping for the object and make sure that it has the fewest properties possible to make it useful.  Sometimes too many properties will confuse TC even if they are all unique.

     

    or

     

    2) Delete the name mapping branch that has the object and remap it manually.  

    • lleppert's avatar
      lleppert
      Contributor

      Hi Marsha,

       

      Thank you for your response. Unfortunately, I have already tried both of these suggestions. Originally, the mapped object had only one property. I tried adding others, using a different identifying property(but only one), or trying a few different combinations of properties.

       

      I've deleted the name mapping branch a few times now and have had no luck. I even totally wiped out all of my namemapping then spent an hour manually mapping my entire software. Didn't work. I'm beginning to suspect this is a testcomplete defect.

       

      I have uninstalled TestComplete and re-installed it, so I am hoping that will clear up any issues in the future and will just have to re-record the two that are having problems.

       

       

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        We have a couple of fields that change properties as the UI loads or data loads but it took a long time to see that manually.

         

        We check for the two properties in order with If Object and perform the same action no matter which one it finds.  Since you aren't seeing it change, you could use a WaitProperty or other Wait to purposefully wait for the object/property to load.