Page 1 of 1

Another dynamic (sorta) identification

Posted: Tue Jul 05, 2016 4:10 pm
by Nono
Hi guys,

So I have this object that keeps changing within its xpath - a specific div within the path keeps getting one of two values each time I try to identify it. See the snapshot included. (either 3 or 4 as the div index)
How can this issue be solved?

link to the snapshot:
https://www.dropbox.com/s/e2lvlpe7cyji5 ... rxsnp?dl=0



Thanks :)

Re: Another dynamic (sorta) identification

Posted: Wed Jul 06, 2016 11:41 am
by odklizec
Hi,

At first, the snapshot complains about not enabled IE Ranorex addon. Make sure the addon is installed and enabled, otherwise the element recognition in IE could be very slow and not as reliable.

At second, have you tried to remove the index from xpath? You see, element indexes are pretty unreliable and should be used only as a last resort (if there are no unique attributes you can use).

Apparently, there are no usable attributes for given div. So you will either have to remove the index or eventually, replace all divs between 'body' and last 'div', with // shortcut. So the path should look like this...
/dom[@domain='192.168.10.52']/body/div/div/div/div/div[@innertext='AutomationHDFlash']
or...
/dom[@domain='192.168.10.52']/body//div[@innertext='AutomationHDFlash']

Before using the xpath in repo, make sure either of xpath returns correct and unique (just one) element. If not, you will have to find another way how to identify the last element. Unfortunately, the snapshot you posted does not contain the ancestor subtree elements. So I can't suggest an alternative xpath to identify the last element (e.g. using element label or neighboring element).