Forum Discussion

pkudrys's avatar
pkudrys
Contributor
2 years ago

NameMapping - priority of tracked/recorded element properties

Hi guys,

 

Is there a way to tell the TC to prioritize/de-prioritize element attributes (during recording or tracking elements)? In many cases, TC simply ignores beautiful and unique element ID and uses much more complicated and, in may cases, even useless identification attributes. In such cases, I'm forced to replace them all manually. I'm coming from Ranorex word, where the element Spy has an option (ugly but still an option) to set the weight of xpath attributes. Is there something similar in TC (even hidden in configuration files)? Thanks.

 

Here is the menu, I want to add to Name Mapping:

 

And this is what TC actually added:

4 Replies

  • Hi,

    Thanks for the suggestion. Although it looks promising, templates cannot be used with selectors and web objects. From TC help:

    Note: Name Mapping templates cannot use selectors. Creating templates for web objects is not available when mapping by using XPath expressions and CSS selectors is enabled.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Ah ok.

     

    Is TC failing to recognise the objects during playback?

  • No, it finds the object. But in the particular case, shown in the screenshots, I simply need to use div cssmenu, as a starting point for FindChild method, which is supposed to find child menu items, based of defined menu item strings 😉 I just want to create a parametrized keyword module. In other words, the mapped object (by TC) picks (from my perspective) illogical element, because there is an element with ID, which is perfectly usable. So it would be nice to have a possibility to tell the TC to prefer certain elements/attributes, over others.