How to update xpath in repo automatically....

Best practices, code snippets for common functionality, examples, and guidelines.
User avatar
_KK_
Posts: 24
Joined: Tue Nov 21, 2017 12:51 pm

How to update xpath in repo automatically....

Post by _KK_ » Fri Jan 12, 2018 10:18 am

Hello Forum!

How to update RanoreXPath in repo automatically when the Location of controls alter many time (and fast) due to development activities?

In most Projects the testing is in parallel to development (entwicklungsbegleitendes Testen).
So the Location of controls alter from Version to Version to be tested.
It is most of the time a big effort to make the TestSuite running.

The update of the TestSuite will be done by Hand: inspect the xpath and adapt it.

Is there a mechanism to do this on the fly, when the new Version is active and the TestSuite is running and will check for the former xpath and the needed (cuttent) xpath?
One property to identify the control is working with the addressid.

Thanks in advance for any hint.

BR

KK

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

Re: How to update xpath in repo automatically....

Post by odklizec » Fri Jan 12, 2018 10:38 am

Hi,

I'm afraid, there is no such option like an automatic update of repo xpaths. If the xpaths are constructed wisely, there should be no need to update them after minor UI or even moderately complicated UI changes. If the UI design changed dramatically or the element IDs are completely different, there is no other way than to update the repo elements manually.

Could you please post a sample xpath and snasphot of the typically failing element (after UI change).

Generally speaking, in your case, you should avoid using element indexes and too concrete xpaths. Also, you should use rooted folders, which should help you with easier repo updates. You see, instead of changing every single xpath, you should change only the rooted folder xpath. This should dramatically reduce the amount of manual repo changes.
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