Forum Discussion

jimsmith_1's avatar
jimsmith_1
Contributor
14 years ago

Why does TC create new pages in NameMapping when the page is mapped already?

I've noticed the following when recording new keyword tests in TestComplete...



I interact with an object on a new page.

TC records the interaction in the keyword test and maps the object to a new page.

For example "PageExtranet" recognised via URL http://recruitmenttest/xyzextranet/register.htm.

Now, I know that I will be running this test in different environments, not just the "recruitmenttest" environment where I am doing my recording.

So, I modify the page URL recognition string to http://*/xyzextranet/register.htm. so that the page will be found in all environments where I run.

However, when I subsequently record an interaction with another object on the same page, TC ignores my existing mapping.

It creates an entirely new page mapping called "PageExtranet1" recognised via URL http://recruitmenttest/xyzextranet/register.htm.

So I now have the same page mapped twice. There are some pages I now have mapped six times.

Instead of seeing all of the page objects in one place in NameMapping, I have to search through multiple pages.



Does anyone know why TC does this? Is there a way of stopping it?



Thanks, Jim




3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    I would suggest actually to start creating tests and code without using recording.  Recording is "dumb" in that it doesn't necessarily take into account existing tests (keyword or script) when it records a new test.  It doesn't always utilize things like Extended Find and wild-carded properties when doing name mapping.  It is simply recording actions against objects and may just create new ones.



    I've found that recording is an excellent tool to learn how to write tests and to investigate how a test should be written to achieve a certain goal. But when it comes to maintainable, sustainable, efficiently written tests, recording does not measure up and it is best to start creating tests without depending upon recording to do so.
  • So, is there a better way to set up NameMapping other than by recording? Is there some help documentation available on this?




    Thanks, Jim