How should I map an object that applies in all test environments
I have several test environments, and I mapped an object in one of the environment and it was working fine in that environement, but after I switched to another test environment, TestComplete was telling me the mapped object cannot be found anymore, but when I mapped the object, I didn't select any properties that specify my test environments, I just select the properties, like type and contentText, that are common in all test environments. So can anyone tell me why it cannot find the object anymore, and how can I fix it?
That specific object may not be found but TestComplete uses the parent objects as well to find the object... so, it could be further up the tree of ancestor objects as to where the problem may be. In your screenshot, your object is a child object of a web page... since you're talking about different environments, I'm assuming the web page is bening mapped by a URL that is different in each environment. What you should do is, on the page object, wildcard with the asterisk (*) character the leading parts of the URL that are different between environments.
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
@tristaanogre has it right as usual!
Just adding this reference:
Unable to find the following object when executing the Click command:
The parent object was not found:
I noticed that it failed when I gave the direct mapped name to it, but it worked when I use another reusable action, which looks for any object that has contentText with "All Organizations" on the page. So this is confusing me why it doesn't work when it has the direct address to the link?