Forum Discussion

sirping's avatar
sirping
Occasional Contributor
3 years ago

XPath Namemapping: Set a prefered attribute

Hello,

 

We recently switched to using XPath for our Namemapping (which is great btw) but one thing kind of bothers me: When I use the Object Spy to add a new Entry into the namemapping it always chooses some random attributes to uniquely identify the object. We use data-testid's on all important objects and of course what to use that instead. Right now the whole mapping process is very tedious, since we always have to map the object and then change the XPath manually. Is there a way of setting "data-testid" as a default preferred attribute to always map to (whenever avalible). My colleague mentioned that this is possible to set somehow but it doesn't work...

 

Please help, since this would make the whole process a lot easier.

 

Thanks, 

SirPing

1 Reply