Forum Discussion

r12_aparna's avatar
r12_aparna
Occasional Contributor
12 years ago

Object browser and name mapping objects

Hi, I am trying to maintain the original script in test COmplete 8.0 version. When I execute a routine, it has several errors popping up. 1. Object does not exist, though it exists in ob...
  • agabriel's avatar
    12 years ago
    The quick fix is to capture the mapping of the objects that throw up errors using the Object Spy and update your script. The long term preferred solution is to make your tests more dynamic using wildcards and unique identifiers.



    I had this problem when I first started using TestComplete as well. It turned out that in my case, I was using a different browser which I hadn't anticipated...so I adjusted the test to the new mapping and the object was identified; all was good.



    Then it happened again...this time the developers has changed something...found out what they had changed (AND opened up a channel of communication with them for when something like this changes...) then adjusted the test to the new mapping so object was identified and all was good again.



    The last time it happened, it was the result of the test executing too quickly and not allowing the web application to execute its behind the scenes interface changes. It didn't happen when I made the test and the few times I ran it; but then it happened when our VM slowed down. I added some delays between clicks and all was well once again.



    To avoid the problem, update your tests to use wildcards wherever you think a value might change. I find that you shouldn't using Name Mapping too extensively with web application testing; not because it doesn't work well, but moreso because web application objects change too frequently. I prefer to use the 'Find Object' operation with 'ObjectIdentifier' as the primary way to locate objects in a web application.



    In the case of your first example, you might be able to just use:



    *WPFObject("AutoSelectTextBox", "", 1)"



    Then, if the position/mapping changes, the test will still find the object you are looking for. This will only work with the 'Find Object' operation.