Two factor object identification inside a table

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
kevjan
Posts: 2
Joined: Thu Jan 24, 2019 2:28 pm

Two factor object identification inside a table

Post by kevjan » Thu Jan 24, 2019 2:58 pm

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:
The attachment Objects_inside_table.PNG is no longer available
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:
Objects_inside_table.PNG
Objects_inside_table.PNG (22.16 KiB) Viewed 55 times
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!

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4421
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Two factor object identification inside a table

Post by odklizec » Fri Jan 25, 2019 12:11 pm

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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

kevjan
Posts: 2
Joined: Thu Jan 24, 2019 2:28 pm

Re: Two factor object identification inside a table

Post by kevjan » Fri Jan 25, 2019 1:13 pm

Ooops somehow my second screenshot was´nt posted. Here it is:
Spy-Path.PNG
Spy-Path.PNG (28.35 KiB) Viewed 49 times
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.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4421
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Two factor object identification inside a table

Post by odklizec » Fri Jan 25, 2019 1:16 pm

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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration