Forum Discussion

acm's avatar
acm
Contributor
8 years ago

The mechanics of "Properly Mapping an Object"

Hello!

 

I have read on the Forum where many experts advice users to make sure "objects are properly mapped".  Could someone kindly provide succinct steps to do that?   As a newbie, I still have but a vague idea...

 

1.  Record your (keyword) test.

2.  Observe in the NameMapping that the object is present.

3.  .... what other steps follow?

 

Most objects I can map okay - i.e. I record & execute the tests fine.  But I also run into a few objects that cannot be found AFTER recording.  Like this one - it mentions the URL (Page objectype) but I don't know if I should follow the recommended DELETE action.  I don't want to delete something erroneoulsy.  Most importantly, I wish to know how to properly map this linkPagination10 object.   (See attached).

 

Thanks again! :-)))

Arlene

  • Properly mapping = Don't depend solely on the automatic mapping provided by TestComplete.  

     

    Many times, properties used by mapping have variable values. For example, in the application we're testing right now, certain objects have an ID that, while it appears to be a static id, changes every time you go to the same screen.  So, the object itself is always the same, but the internal properties used for identification are changing dynamically at runtime.

     

    In your particular situation, the URL you have mapped includes an # after the Index in your name mapping.  The "real" URL doesn't include that symbol.  I don't know how it got there, but that's the difference.  If you suspect that the URL of the page is going to have variable information after the index, then in your mapping, you should replace the # with an *.

     

    So... that's the example for your particular situation.  But each component, application, scenario has different situations.  It honestly will take a bit of work on your part to spend time observing and investigating the objects within your application under test to determine, after the object has been mapped, whether the properties used by TestComplete are sufficient, whether they include anything specifically dynamic, etc.

     

    There are a few videos out there for this process.  if you go to https://support.smartbear.com/testcomplete/videos/?utm_source=TestComplete&utm_medium=StarterPage, there are several videos on that page that give a good insight on how to do this stuff.

     

    Additionally, check out

    http://www2.smartbear.com/download-mqi-outbound-testcomplete-record-replay-webinar-email.html#_ga=2.181578215.154157366.1502108958-1826864053.1477590786

     

    https://support.smartbear.com/screencasts/testcomplete/reliable-tests-for-dynamic-objects/

     

     

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Properly mapping = Don't depend solely on the automatic mapping provided by TestComplete.  

     

    Many times, properties used by mapping have variable values. For example, in the application we're testing right now, certain objects have an ID that, while it appears to be a static id, changes every time you go to the same screen.  So, the object itself is always the same, but the internal properties used for identification are changing dynamically at runtime.

     

    In your particular situation, the URL you have mapped includes an # after the Index in your name mapping.  The "real" URL doesn't include that symbol.  I don't know how it got there, but that's the difference.  If you suspect that the URL of the page is going to have variable information after the index, then in your mapping, you should replace the # with an *.

     

    So... that's the example for your particular situation.  But each component, application, scenario has different situations.  It honestly will take a bit of work on your part to spend time observing and investigating the objects within your application under test to determine, after the object has been mapped, whether the properties used by TestComplete are sufficient, whether they include anything specifically dynamic, etc.

     

    There are a few videos out there for this process.  if you go to https://support.smartbear.com/testcomplete/videos/?utm_source=TestComplete&utm_medium=StarterPage, there are several videos on that page that give a good insight on how to do this stuff.

     

    Additionally, check out

    http://www2.smartbear.com/download-mqi-outbound-testcomplete-record-replay-webinar-email.html#_ga=2.181578215.154157366.1502108958-1826864053.1477590786

     

    https://support.smartbear.com/screencasts/testcomplete/reliable-tests-for-dynamic-objects/

     

     

    • AlexKaras's avatar
      AlexKaras
      Champion Level 3

      Hi Arlene,

       

      And in addition to everything said by Robert, I would like to add that you will benefit if you namemap all objects that you are going to interact with *before* recording.

      Namemapping done in advance may help you to avoid the situation when the same object (e.g. web page) will be mapped twice because of changed identification parameters. (Taking your example, the URL may be changed because of added parameters to the address and this may cause TestComplete to create two namemapping entries for, basically, the same page.) So 'proper' :) mapping made in advance may help you to create (record) test that require less corrections after been recorded and that is more reliable when executed.