Recorder snapping to the wrong repository element.

Ask general questions here.
stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

Recorder snapping to the wrong repository element.

Post by stapes » Mon Sep 28, 2015 12:43 pm

I have tried to record the same step over and over.
I am clicking A Cancel button on my AddProfile screen.

Ranorex keeps assuming I am clicking a Yes button on a completely different screen.

Then, of course , it fails on replay because it is looking at the wrong stupid button.

How do I guarantee it gets the correct element?

stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

Re: Recorder snapping to the wrong repository element.

Post by stapes » Mon Sep 28, 2015 12:56 pm

I solved this by taking a guess, and editing androidelement/text[3] to text[2].

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

Re: Recorder snapping to the wrong repository element.

Post by odklizec » Mon Sep 28, 2015 1:16 pm

Hi,

There is no need to "guess" something. If you try the xpath in Spy, you should see if the path is unique or not. If there is more than just one element found for given xpath, Ranorex always uses the first found.

There are two possibilities why you script clicked wrong element. The xpath you first used was either wrong or it changed between the runs? Unfortunately, using element indexes is the least reliable method to identify elements. If there are no other identification attributes you could use in your xpath, you can try to use relationship operators to find proper element based of related (or completely different) elements.

It would be nice if you could post a Ranorex snapshot from your app and the problematic xpath you are using. Maybe we can suggests better way to identify your element than using element index.
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

stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

Re: Recorder snapping to the wrong repository element.

Post by stapes » Mon Sep 28, 2015 3:07 pm

Thank you for your offer, but I do not rightly understand how to get a snapshot at the moment.

Fergal
Certified Professional
Certified Professional
Posts: 298
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Re: Recorder snapping to the wrong repository element.

Post by Fergal » Mon Sep 28, 2015 4:31 pm

stapes wrote:...I do not rightly understand how to get a snapshot at the moment.
You can read how to do that at Creating Ranorex Snapshot Files.