Forum Discussion

whuang's avatar
whuang
Regular Contributor
6 years ago

How should I map an object that applies in all test environments

Hello,

 

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?

Thanks!

4 Replies

  • tristaanogre's avatar
    tristaanogre
    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
      whuang
      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:
      Aliases.​browser.​AdminHomePage.​AllOrganizations

       

      Reason
      The parent object was not found:
      Aliases.​browser.​AdminHomePage

       

      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
        whuang
        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