Forum Discussion

mathare's avatar
mathare
Contributor
13 years ago

NameMapping question

My application under test contains a number of different dialogs (one per data set) that all have the same structure and layout but have different window captions (the name of the data set is included in the window caption). Is there any way of paramterising a name mapping?For example, the dialog may be "Settings for DataSet1" and I would like to name map the dialog and some of the child objects such as tab panes and buttons. Is there a way to set up a "Settings for <dataSet>" name mapping where <dataSet> is a string parameter that will be DataSet1, DataSet2 etc.?

I'm using scripted tests (actually connected applications) in C#, TestComplete version 8.70.727.7.



If it can't be done via a parameter is there a neater solution than just setting up multiple name mappings, one per dialog? There is a fairly small number of dialogs (6-8) so adding that many name mappings isn't a big chore but if it can be parameterised or similar that would make maintenance easier, obviously.



Thanks in advance

Mat

3 Replies

  • Actually, I am just being dumb on a Friday afternoon?

    The data sets all follow a naming convention so I can use wildcards in the window caption and map to "Settings for DataSet*" can't I?

    While that won't uniquely identify the dialog on screen I can use some best practice in my script to make sure no more than one such dialog is visible at any one time. I don't need to compare the contents of "Settings for DataSet1" with "Settings for DataSet2" for example so one mapping with a wildcard in the window caption ought to give me what I need. I think.

  • Funnily enough Helen it was halfway through watching that very webinar that I realised I could use the wildcard solution :)