Forum Discussion

Blur's avatar
Blur
Contributor
10 years ago

Mapping problems and such

Hello,

 

I am currently working with multiple calendars.  TestComplete's auto mapping works fine for the most part.  However, when I got to the second calendar the issues appeared.  It would click the wrong dates or not the dates at all.  I decided to manually map the calendars only to find out that they were both trying to be mapped as the same object.  The odd thing is when I try to map it, it says it is already mapped and shows the previous calenedar.  But when I try to highlight object on screen, it won't find it.  Basically, it thinks it is mapped but it is not.  I was able to fix this problem before by remapping the whole thing but this time around I've made too much progress.  Is there a way to fix this without re-mapping?

  • I don't believe there's a way to do a mass update in name mapping.  If I recall, there might even be a post in Feature Requests for that.

     

    Run it and catch them one at a time is what I would be doing too.

  • Sorry dude. Snowed under at work the last few days and trying to get things tidied up before holidays. Not had a chance to do anything with this.

     

    In short though ....

     

    My function would take in:

     

    The calendar as an object, or a reference to it.

    A date (in parts if you want to make life easier).

     

    Then it's just a matter of starting from the highest level (year), and working your way down. Select a year, then month, then day. Didn't look properly at the structure. Some of it may involve iterating through a collection (if it uses lefgt right button or something for month?) where day may just be using FindChild on a table.

     

    Give all your searches & loops meaningful exit caluses so you can log appropriately if someone tries to select something like the 31st February.

     

    All depends how the internals are built up really.

  • There are a couple of things I would try. 

     

    First, create another project in TC just to use as a sandbox.  Then, manually name map some of the second calendar and see if you can spot what it has in common with the first calendar.  If that's obvious, then maybe you can update your existing mapping to use some wildcards that will help it fit both calendars.

     

    If that doesn't seem feasible, then you can fully map the second calendar in the sandbox, export the name mapping, then merge it with your existing mapping.  If there are too many conflicts, then remapping might be still be what you need to do, but maybe just part of the tree.  You don't always have to delete the whole branch.

    • Blur's avatar
      Blur
      Contributor

      Your first suggestion is actually what I did prior to seeking help.  The calendars are actually mapped in different areas when I create another project.  Like if you look at screenshot for example, one would be in pageAutomationInstinctbetaGongos and the other would be in pageAutomationInstinctbetaGongos1.

       

      I haven't tried to use wildcards to fix this yet.  I'll give that a try and if that doesn't work I'll try your second suggestion.

    • Blur's avatar
      Blur
      Contributor

       I don't really mind remapping the whole tree but is there a way to update all the chances in the testcase more efficiently or do I have to run each test case and update when they come up as an error/change.

      • Marsha_R's avatar
        Marsha_R
        Moderator

        I don't believe there's a way to do a mass update in name mapping.  If I recall, there might even be a post in Feature Requests for that.

         

        Run it and catch them one at a time is what I would be doing too.