Page 1 of 1

Two factor object identification inside a table

Posted: Thu Jan 24, 2019 2:58 pm
by kevjan
Hi everbody,

i currently try to find a specific object inside a table and want to combine this with another object (link). Both objects are in the same row but in differnt columns:
Objects_inside_table.PNG
I want to click on the second object (Img 'Starte Aufgabe'). The problem is, that we have this object in every row. If we add a new row the direct path to the object could change if the row is added above the current row. So my plan is, that i combine the identification with a second factor - in this case the link (1).

One solution is this path:
Spy-Path.PNG
But it takes between 20 to 30 seconds until the object is found. Do you know a faster way to to this?

Thanks in advance!

Re: Two factor object identification inside a table

Posted: Fri Jan 25, 2019 12:11 pm
by odklizec
Hi,

Please upload a Ranorex snapshot (NOT screenshot) of the table. Screenshots are useless for xpath evaluation. Also, please post the xpath you are currently using. Both snapshot and xpath are crucial pieces of info. It's impossible to provide a meaningful suggestion without them. Thanks.

Re: Two factor object identification inside a table

Posted: Fri Jan 25, 2019 1:13 pm
by kevjan
Ooops somehow my second screenshot was´nt posted. Here it is:
Spy-Path.PNG
In the meantime we found a faster way to find the object:

/dom[1]//div[#'content']/div[2]/table/tbody/?/?/table//a[@innertext~'^migewa\ -\ TA\ -\ Prüfung\ auf']/../../../../../../descendant::img[@alt='Starte Aufgabe']

But maybe there is better to do it.

Re: Two factor object identification inside a table

Posted: Fri Jan 25, 2019 1:16 pm
by odklizec
Hi,

Once again, plain screenshots are useless for xpath evaluation ;) Please post a Ranorex Snapshot instead...
https://www.ranorex.com/help/latest/ran ... hot-files/

BTW, using something like this /../../../../../../ in the xpath (and element indexes) is definitely a very bad idea. This would make the xpath unreliable in long term run and most probably unmaintainable too. Please post the snapshot, so people here can analyze it and suggest better solution.