Forum Discussion

tgeesa's avatar
tgeesa
Occasional Contributor
13 years ago

Location of Objects vs Name of Objects

Hello all,



I have been using TC 8.70.x to do automated web testing of our internal systems.  I have had a lot of success with TC and like its functionality.  When I showed my manager my work, he was concerned that TC was saving the location of each object instead of the name of each object.  Because these systems are updated quarterly, his objection is that the location of a button (for example) might change, which would ruin the test because it can't find that button.  If the name of the button was used instead, it would be ok.



As an FYI, I am using Keyword tests for most of the work and adding scripts as necessary.



Does anyone have any input? 



Thank you!

3 Replies


  • Hi Tyler,


     


    The answer to your question will depend on the way you used to create the test. I suppose that you use the Recording feature for this, right? In this case, TestComplete uses the full path to the recorded objects. But if the button changes the location, it means that the tested app's GUI will be changed. As TestComplete creates GUI tests, it's expected that they should be changed somehow to update the test to the newest tested app version.


     


    If you want to create a test that will not bind to the full path to the object, you can use different TestComplete methods to find the needed objects based on their unique parameters: FindChild, Find, FindAll.


     

  • tgeesa's avatar
    tgeesa
    Occasional Contributor
    Hi Tanya,



    Thank you for responding.  For the most part yes, I have been using the record function.  I browsed through those artcles and it looks like more work than is worth it.  I have had more  conversations about it with him and we think our tests should be ok long term (hopefully few gui changes.)



    At any rate, I'll just table this problem as job security and move on.  Thank you again for your help!
  • vajindarladdad's avatar
    vajindarladdad
    Frequent Contributor
    Hi Tyler,

    I would recommend you to use NameMapping file. You have to follow the following steps to make your automation better and easier.



    1) Map the required objects.

    2) Record the test

    3) Convert the Keyword test to Script.



    If there is any object hierarchy , remap it and try to give same "Alias" as it was before. This will save your lot of time.



    I hope this has been of some help.