Ask a Question

the relationship between name mapping map and testscript

seafalcon
Contributor

the relationship between name mapping map and testscript

After I recorded several testscript, I just have one NameMapping item in the project. that means all testscripts share one namemapping item in same project? is it possible for one project to contain multiptle nameMapping items? what should testers do if there are overlapped objects cross different  test scripts? or different objects have the same name during the recording?



May I add new name mapping definitions into exsiting name mapping items? I know I can delete them.. but not sure I can add or not .




Thanks 


Find the faith in life
3 REPLIES 3
YMinaev
Staff

RE: the relationship between name mapping map and testscript

Hi Philip,



>> that means all testscripts share one namemapping item in same project?

That is right.



>> is it possible for one project to contain multiptle nameMapping items?

No.



>> what should testers do if there are overlapped objects cross different  test scripts?

What do you mean by "overlapped objects"?



>> different objects have the same name during the recording?

You need to choose a set of properties for mapping that uniquely identifies each object.



>> May I add new name mapping definitions into exsiting name mapping items?

Yes. Double-click the item you need to edit and apply all necessary changes (see the Managing Mapped Objects help topic).
------
Yuri
TestComplete Customer Care Engineer

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
seafalcon
Contributor

RE: the relationship between name mapping map and testscript

The overlapped objects means some objects are recreated in the runtime, or the newly created objects which have same reference(classname, wincaption, or index) with the previous ones.. but in different position.



I think you misunderstood my last question. What I mean is can I create a new name mapping definition for objects?

such as : I want to create a new mapping definition in name mapping item:




lookupedit3=Alias[mainForm][gridControl]("lookupedit","3" );




is it possible? and how to do it?




Thanks

Find the faith in life

RE: the relationship between name mapping map and testscript


Hi Philip,





>>>

The overlapped objects means some objects are recreated in the runtime, or the newly created objects which have same reference(classname, wincaption, or index) with the previous ones.. but in different position. 

<<<

If an object is recreated, you need to refresh the mapping information by calling the RefreshMappingInfo method right after the recreation.





If a new object is created, you need to modify the name mapping scheme in such a way that TC can uniquely identify the necessary object (don't forget to call RefreshMappingInfo before obtaining the new object).









>> What I mean is can I create a new name mapping definition for objects?

As far as I understand, you need to add items to the name mapping scheme from your script. You can do this by using the AddNamedChild method (see the Methods and Properties Added to Mapped Objects help topic).





However, we do not recommend that you use this. More convenient approach is to use the FindChild method to find the necessary object by specific property values.
--
Dmitry Nikolaev

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: