Forum Discussion

romanmfs's avatar
romanmfs
Frequent Contributor
7 years ago

Remapping Issues. Inconsistencies.

I have a question that have been bothering since I started using TestComplete in August. This issue seems to come back more and more often. 

 

Hi all!

Happy New Year!

 

We have couple of websites that we test using simple keyword tests.

For example https://www.consolidatedcredit.org/

where we test lead forms that have some fields. (see screenshot).

 

We have weekly releases to the site with small layout changes etc w/o touching the fields.

The problem is, every time after release is done and i try to run my test cases, they are all broken. TestComplete cannot even navigate through site menu which never changes. So I always have to remap all the objects manually.

 

Is there are something that I am missing? Why would my mapping always break? If this is something I will always have to go through is there more efficient way to remap the objects. (now I do one by one and there are many).

 

 

Please help me to make my automation process more efficient and actually serve its purpose. 

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Well, it depends upon what needs to be done in the remap...  Do you need to change properties?  Are there new DIV (Panel) objects that weren't there before? Etc.

     

    As I mentioned elsewhere, we just recently had to do something similar.  A new version of bootstrap was applied to our application which changed a few properties here and there and added some new DIV panels in the hierarchy.

     

    If it's just properties that need to change, you should investigate if there's some set or properties that maintain value consistently and use those.  Alternatively, you could work with your development team and have them help you out by making sure that there's a consistent set of properties for you to use.

     

    If it's additional panels that are being added in (or removed) Look into using some judicial placements of the "Extended Find" checkbox.  

     

    Say, for example, I have something mapped like

     

    NameMapping.Sys.browser.MyPage.MyPanel.Panel1.Panel2.MyTextBox

     

    Then a new version is pushed through and, between Panel1 and Panel2, there's now some new panel there.  Your solution could be, simply, to click the "Extended Find" checkbox on the Panel2 mapped object.  Then it doesn't matter how many Divs there are between Panel1 and Panel2, it will find it.

     

    Finally.... and this I'm not clear on because your screenshots point out Aliases but we don't see the actual mapping part...  but keep in mind that there's a difference between an Alias and a mapped object.  The Mapped object is how TestComplete identifies it and starts with NameMapping.Sys at the root.  This is the full hierarchy and object identification structure you've defined.  Aliases are an "in between" layer between the NameMapping engine and your code.  Each alias points to a NameMapping object.  So, when you reference an Alias in your code, the tool goes to that Alias and references the NameMapping object to make the identification.

     

    What this means is that you can re-organize your NameMapping hierarchy and properties as I described above.... but so long as the Aliases don't change, you should never need to touch your code.

  • romanmfs's avatar
    romanmfs
    Frequent Contributor

    Thanks for the fast reply and explanations!

    I am new to TestComplete so I am still learning.

     

    So the way i fix the issues I double click on the object inside of the keyword test and then click on "Drag the target to point to the object" and then i bring the mouse to the right field to grab it. 

     

    Now whats weird to me, if I hit on "highlight" even before fixing anything, TestComplete highlights the right field, so it "knows" that that's the field, why would not it click on it during the actual test?

     

    Also I remapped the first name field using the "drag the target to point to the object" and then I looked at the name of the object starting with "NameMapping.sys..." and after I remapped it, it did not change, but it does the trick and fixes the problem during the test run. (see screenshot). So am I actually changing the properties of an actual object by using this method or remapping the object itself. I am lost, sorry with so many confusing questions.

     

     

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      OK, so, there may be a couple of problems.

       

      Problem 1 may be a timing issue where the objects might not be present on screen or recognized before TestComplete times out.  Using extended find as you are doing, while it's really a VERY useful feature, does slow down object recognition.  So, during test run, TC might not have enough time to find the object.  You can resolve this by increasing the Auto-wait Timeout setting under Tools -> Current Project Settings -> Playback

       

      Problem 2 might be the following:

       

       

      The object identification problems MIGHT not be with the text field itself but with the parent objects that I have indicated (or others that aren't visible on screen).  formCCv3, if any of it's properties changed might be the culprit... or that footer one... or something else.

       

      Brief intro to nameMapping engine... to identify an object, it starts at the root of NameMapping.Sys.  So, if you have something like

       

      NameMapping.Sys.browser.myPage.footer.frame.textbox

       

      if you are trying to use textbox, TestComplete does the following:

       

      1) Check child objects of Sys to see if there is a browser

      2) If there is a browser, check child objects of browser for any page that matches the property settings of myPage

      3) If myPage is found, check child objects of myPage to for any object that matches the property settings of foot

      4) if footer is found, check child objects of footer for any object that matches the property settings of frame

      5) if frame is found, check child objects of frame for any object that matches the property settings of textbox

      6) if textbox is found, perform the indicated operation

       

      If at any step Testcomplete fails to find what it's looking for, it will fail the whole operation and you'll get an "object not found" error of some sort.

       

      So, in your situation, if any of those parent objects are changing, that could "break" your textboxes.  The solution is to examine those objects and see if there are properties that you can apply to them that won't break as easily.

      • romanmfs's avatar
        romanmfs
        Frequent Contributor

        That makes it more clear. :smileyhappy:

        Thanks a lot for all suggestions. 

        Most likely its  a problem 2.