How should I map an object that applies in all test environments
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Robert Martin
[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
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@tristaanogre has it right as usual!
Just adding this reference:
https://support.smartbear.com/screencasts/testcomplete/wildcard-dynamic-property-in-testcomplete
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@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?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
