A dynamic object (xpath, not id)

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Nono
Posts: 20
Joined: Wed Oct 02, 2013 11:19 am

A dynamic object (xpath, not id)

Post by Nono » Mon Jun 27, 2016 5:28 pm

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

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

Re: A dynamic object (xpath, not id)

Post by odklizec » Mon Jun 27, 2016 5:57 pm

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.
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

Nono
Posts: 20
Joined: Wed Oct 02, 2013 11:19 am

Re: A dynamic object (xpath, not id)

Post by Nono » Mon Jun 27, 2016 6:59 pm

The snapshots are too big to be uploaded here...:(
Thanks anyways,I'll try asking Ranorex support

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

Re: A dynamic object (xpath, not id)

Post by odklizec » Tue Jun 28, 2016 7:17 am

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.
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