why is Relative path slow

Ask general questions here.
rsudhak
Posts: 118
Joined: Fri Jan 04, 2019 1:38 pm

why is Relative path slow

Post by rsudhak » Tue Apr 02, 2019 11:37 am

Hi All,

When I use relative path in my repo , the test run takes too long , any idea ?

my repo item loooks like this :
.//text[@name='Design Length']/following-sibling::text

which is under /form[@title='Settings' ]

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

Re: why is Relative path slow

Post by odklizec » Tue Apr 02, 2019 11:42 am

Hi,

Sadly, without seeing the application's snapshot, it's hard to tell anything definitive. My best guess is that the xpath is too general and it simply takes too long to search entire app for "Design Length" element and its nearest text? Could you please post a Ranorex snapshot (NOT screenshot) of tested app?
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

rsudhak
Posts: 118
Joined: Fri Jan 04, 2019 1:38 pm

Re: why is Relative path slow

Post by rsudhak » Tue Apr 02, 2019 12:20 pm

how can I take the snapshot of the current repo?

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

Re: why is Relative path slow

Post by odklizec » Tue Apr 02, 2019 12:30 pm

Hi,

You must follow the steps described here:
https://www.ranorex.com/help/latest/ran ... hot-files/

Basically, you must set the app to the expected state, when the repo element is available in UI. Then via Spy, you can create the snapshot of given element. But in your case, i would suggest to save snapshot of entire app and not just the given element. In Spy, select root element of tested app and save its snapshot.
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

rsudhak
Posts: 118
Joined: Fri Jan 04, 2019 1:38 pm

Re: why is Relative path slow

Post by rsudhak » Tue Apr 02, 2019 12:38 pm

snapshot attached
You do not have the required permissions to view the files attached to this post.

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

Re: why is Relative path slow

Post by odklizec » Tue Apr 02, 2019 12:52 pm

Hi,

As I've expected, the path is simply too short for the UI. Just expand all tree nodes and you will quickly see how many elements there is. And your xpath makes Ranorex to go through all of them, to find all appearances of text[@name='Design Length']. So I would suggest to add few more items to the xpath, like this...
form//element[@classname='FinalCircuitCableView']/container[@classname='ScrollViewer']//text[@name='Design Length']
At next, you are using somewhat old and no longer supported version 8.3.1! It's time to upgrade to, at least, 8.3.3 or 9.0 ;) And finally, there is issued a WPF instrumentation warning, which means that Ranorex identification capabilities are limited with your app! You should try to run Ranorex Studio/Spy in administrator mode. This often helps with similar instrumentation warnings.
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

User avatar
qwertzu
Posts: 284
Joined: Wed Jan 25, 2017 11:08 am

Re: why is Relative path slow

Post by qwertzu » Tue Apr 02, 2019 1:54 pm

hi

in addition to what odklizec already mentioned:
Avoiding double slashes (//) will decrease the search time tremendously.
At least using a question mark for each element in between, instead of the double slash, will be way faster.
However, it always depends on your application if the path is still robust enough afterwards.

regards,
qwertzu

rsudhak
Posts: 118
Joined: Fri Jan 04, 2019 1:38 pm

Re: why is Relative path slow

Post by rsudhak » Tue Apr 02, 2019 2:27 pm

I will try that, Thank you. The main reason to have a relative path is to avoid maintenance issues, not only that if the same element is in the two different places, I need not have to create two different items in the repo, I believe if we have a relative path and we are on the right page/form, it should be quick to find the elements