Forum Discussion

nika912's avatar
nika912
New Contributor
8 years ago

NameMapping problems

Hi everyone.

 

I'm new to TestComplete and i'm having problems with namemapping. I am using TestComplete to test .NET based application.

 

Issue:

 

In these .NET app, user does a few procedures and after he is finished app creates a basket with selected items. In namemapping everytime the basket is created it's generated with different name. 

 

Can please anyone help me, how can I write a script where I can reference to created basket and the elements with in?

 

 

 

 

3 Replies

  • You need to either:

     

    • Use wildcards in your name mapping to account for the parts that change. This may or may not be viable. Hard to say without seeing exactly how it changes.
    • Use different identification properties to identify the basket. And/Or use required children or something to help with identification.
    • Or possibly use findchild on a parent/container object which does not change each time through.

     

    Kind of hard to say for sure without seeing what properties you are using and what's changing during each run. But there are a few ways of doing it.

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      I'm with Colin_McCrae. You may not be able to map the basket directly but map the parent object for the basket and then use some sort of "Find" function in your code to be able to  find the specific basket. Alternatively, your criteria for identifying the basket object may need to use parameters other than the name to map it but things like class, label, etc.

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    If you need some more specific examples, you can post a copy of the Object Spy reading of the basket and show us how it changes each time.