Forum Discussion

whuang's avatar
Regular Contributor
6 years ago

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?


4 Replies

  • tristaanogre's avatar
    Esteemed Contributor

    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.

    • whuang's avatar
      Regular Contributor

      tristaanogre Marsha_R the parent page already had "*" in the URL as you can see in the screenshot below. The details message is


      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?

      • whuang's avatar
        Regular Contributor

        Ok, I think I figured out why. The URL I used to sign into this environment landed the user on https://*/admin page, but the parent object URL is pointing to https://*/admin/default.aspx, that's why it cannot find it. It works now after I use a complete sign in URL. Thanks Marsha_R tristaanogre