There is a same web application deployed in both test environment and production environment,and now I have to develop automation tool based on the web application in test environment firstly because of the limitation of production environment.
The issue i met is that it didn't work after migrating automation tool developed in test environment to production environment via changing the start page property of web.os ,like the URL of production is http://XXXX.com while test's is http://test.XXXX.com,I saw most elements are mismatched.It means i should interrogate the elements again,Is there any solution can fixed this issue?after all the web application is same.
Some controls, web pages in particular, use a URL match rule. It is not uncommon to have different URLs for a test verses production environment as you start. To handle this condition you will need to modify the URL match rules to match both URLs. In your example you use http://XXXX.com and http://test.XXXX.com. You could change the URL match rule to only match on XXXX.com with Mode set to EndsWith. The rule would then match the XXXX.com in both URLs.
A lot of times a web page can be uniquely identified using only the Title match rule. If this is the case for your application you could delete the URL match rules.