Page 1 of 1

A dynamic object (xpath, not id)

Posted: Mon Jun 27, 2016 5:28 pm
by Nono
Hi,

So I have this web element (a check box) that I repeatedly click on during a test. It has a dynamic path that keeps changing every time I refresh the page, and that blog post about dynamic ID's is not helpful in this case.
It looks like this:

/dom[@domain=$ObserverDomain]//div[#'c21071']/?/?/tag[@tagname='v-checkbox']
This checkbox has a name (title) right next to it but ranorex cannot 'see' it.

the following div attribute: div[#'c21071'] is dynamic. How can I automate this?
I also saw this post but it looks a bit obsolete...

Thanks,
Nono

Re: A dynamic object (xpath, not id)

Posted: Mon Jun 27, 2016 5:57 pm
by odklizec
Hi,

Please post a Ranorex snapshot of the checkbox in question and make sure there is saved also the title you mentioned. Or create a separate snapshot for the title. It's definitely possible to refer to an element via xpath of another element (e.g. title). But it's hard/impossible to suggest something reliable without seeing the snapshot.

Anyway, if the unique ID of the div you mentioned is dynamic, you will most probably to remove the unique id from the xpath and eventually replace it with something else. But still, please post a Ranorex snapshot so we can suggest something more concrete.

Re: A dynamic object (xpath, not id)

Posted: Mon Jun 27, 2016 6:59 pm
by Nono
The snapshots are too big to be uploaded here...:(
Thanks anyways,I'll try asking Ranorex support

Re: A dynamic object (xpath, not id)

Posted: Tue Jun 28, 2016 7:17 am
by odklizec
Hi,

You can always use a file service, like onedrive, dropbox, etc. and here post just a link. Eventually, you can significantly reduce the size of snapshot by disabling (unchecking) "complete ancestor tree" option in general settings (as described here). But then you need to save snapshot from parent element, containing both checkbox and its title.