Forum Discussion

binu_vijayan's avatar
binu_vijayan
New Contributor
11 years ago

Support of Object variable in Name mapping (WPFControl text)

Hi,



We are using TestComplete version 10.1.

Our AUT supports multiple languages. The language specific strings (or control captions/texts) are stored in XML files.

We would like to use these strings in name mapping for object identification in different languages.

We could parse the xml and stored the keys in an Object variable (as project variable) using scripting. (there are 500 keys in the xml).

While trying to associate these object variable in name mapping ( WPF Control text attribute), the following message displays in the value filed 'Table, DBTable and Object variables are not supported.'



Please confirm whether the latest version of TestComplete support Object variable in name mapping?



Or, 

is there any way to solve our issue?

 
  • "If name mapping support object/dictionary variable"



    It doesn't.



    But it does support project variables if you want to set up dynamic identification properties. You could use those and then set up a startup/config/ini script which sets all these for the language in use during the run. (All read in from a file or DB or something - whatever is best for the way this info is currently stored)



    Would be a bit of work to set up all the project variables but it should do what you need once in place.
  • Hi Binu,



    I was facing same problem and to resolved it, i used "clrfullclassname" and "WPFControlOrdinalNo" to map that object instead of WPFControlText. Now i can use that namemapping for all the object whose clrfullclassname and WPFControlOrdinalNo is matched with that object. I hope this may help you.



    Regards,

    Mayank Gupta
  • Hi Mayank,



    Thanks for your suggestion.

    We are already doing similar thing (storing unique property instead of caption) for the time being. But for most of the controls (around 300 controls) we couldn’t identify a unique property with a constant property value.

    We have one more objective in using captions in Name mapping. 

    If we use captions in name mapping, those captions will also be verified automatically.

    If name mapping support object/dictionary variable, we can parse and load string tables dynamically. Also we can use single name mapping all languages.



    Thanks & regards,

    Binu Vijayan

  • Hello Binu,



    You can also try regular expressions to map the object. It may be help you to map some more objects. And if you get some other way please also share which may be beneficial for me also. One more point you can use Parent.FindAllChildren() to get all objects.



    Regards,

    Mayank Gupta