multiple attribute weightings

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Tomsk666
Certified Professional
Certified Professional
Posts: 33
Joined: Thu Mar 28, 2013 12:59 pm
Location: UK
Contact:

multiple attribute weightings

Post by Tomsk666 » Tue Sep 19, 2017 12:57 pm

Is there a way of creating rules to force Ranorex to use multiple attributes for an adapter role?
For example, in Ranorex, a Cell uses the Text attribute as it has the highest weighting by default.
I want it to use the ColumnIndex AND the RowIndex instead of the Text attribute.

So I create a rule that sets the Text attribute to zero.
I create another rule to set the ColumnIndex to 200
I create another rule to set the RowIndex to 200

So both the Column & Row index has the same weighting - I hoped that Ranorex would then use both attributes, but it doesn't. When I add a Cell object to the repository, it just uses the ColumnIndex.

Is there a way to force Ranorex to use two attributes (or more) when learning UI elements?

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: multiple attribute weightings

Post by krstcs » Tue Sep 19, 2017 1:35 pm

Ranorex uses the first element of all of the highest weights and if that doesn't uniquely identify the element it will use the next attribute. It does not try to use multiple elements because that usually will cause maintenance issues where one of the attributes changes.

Tables are always going to be tricky. What I usually do is have the row be a rooted folder, then I have each column's cell be a separate element under the row's folder. This way you can pick the row and cell easily and if something changes you only have to change the cell element that changed, or the row by itself.

--MyAUT
----MyTable
------MyRow -> row[@rowindex=&MyRowIndex]
--------MyCellByIndex -> cell[@columnIndex=&MyColumnIndex]
Shortcuts usually aren't...

Tomsk666
Certified Professional
Certified Professional
Posts: 33
Joined: Thu Mar 28, 2013 12:59 pm
Location: UK
Contact:

Re: multiple attribute weightings

Post by Tomsk666 » Tue Sep 19, 2017 2:25 pm

Thanks for the reply. Your approach is a good approach, and I'm happy to do this manually.
It would just be nice if you could get Ranorex to use multiple attributes by default for certain elements if you wanted.
My tables are static, but the text changes within the cells, so the text property is not appropriate, but the col & row indexes are static and are.
If I could get it to use multiple attributes, I wouldn't need any manual intervention in object recognition. Perhaps I'll stick it in the feature requests section...

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: multiple attribute weightings

Post by krstcs » Tue Sep 19, 2017 2:33 pm

Honestly, managing the element repo and XPaths is usually the biggest part of Ranorex automation once you get the tests setup and running.

If you want to make a feature request, they only accept them through uservoice.ranorex.com.
Shortcuts usually aren't...