Forum Discussion

gopinathkd's avatar
11 years ago

Web Application URL changed. Test Scripts failing

TestComplete = TC



Hello TC,



I recorded my script for a web application. Once all scripts are done, when i checked my NameMapping, i found many aliases names under Browser. But today my application URL got changed and when i ran a test cases, test case failed. It says object not identified. So how to change and where to change to reflect my new url. Please help me.



Regards

Gopinath
  • NisHera's avatar
    NisHera
    Valued Contributor
    Hi,

    Please go throug this link



    It took some time for me to absorb concept and master it.

    Always get a back up of "NameMapping.tcNM" before doing any changes to name mapping. There is no undo function in name mapping
  • purushindeed01's avatar
    purushindeed01
    Occasional Contributor
    Hi Nishnatha,

                            Its not the problem with  backing up the name mapping , but in each and every test case the URL is reflecting and my project suit contains 1000 Test cases . It is not possible tio change the modify the URL everywhere . Please provide me thye best outcome of it.
  • Assuming you are using mapped objects in your tests .....



    You need to set up your object in such a way that a high level change (such as a base part of a URL) changing is easy to manage. So set your mapped objects up with the base part of the URL (usually it will only be a base part of a URL that changes - in different environments etc) is paramaterised as Project Variable.



    So when the URL changes, you simply update the Project Variable with the correct URL and all your objects will still be recognised. (My current web project does this)



    If you are going to use name maps for objects, you need to give some thought to how you'll use them to identify objects and how to make them maintainable. if you just use the recorded objects, without any checking and tidying up, you are likely to run into problems like you're having at some point down the line. There is no one answer that works in every scenario, different projects and setups will need different ways to set up their name maps depending what they are and how they are likely to change over time. Name maps can work, but only with careful setup and planning - if you want to avoid problems.



    More info on using parameters to identify mapped objects here: http://support.smartbear.com/viewarticle/57310/



    (which is nested within the link nishnatha already gave you)