Randomness in the Repository

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

Randomness in the Repository

Post by stapes » Tue Nov 24, 2015 4:13 pm

I am testing a system on the iPad built using Objective C.

Each day I have to tweak it because items seem to have moved.

On examination of the paths in the repository, there is usually a variation in an index value for a container.

I can give some examples:
Delivery - form/container[4]/container/container/iospicker/list/listitem[@accessibilitylabel='Delivery']
Delivery1 - form/container[3]/container/container/iospicker/list/listitem[@accessibilitylabel='Delivery']
Delivery2 - form/container[5]/container/container/iospicker/list/listitem[@accessibilitylabel='Delivery']
These 3 are the same field, but it randomly moves all over the place. You can see that the only difference is the index value of form/container.

This is not coming from development.

How do I pin these things down? I can't rewrite the whole suite every morning - kind of defeats the object.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Randomness in the Repository

Post by krstcs » Tue Nov 24, 2015 5:47 pm

Take the index out of the XPath.

form/container/container/container/iospicker/list/listitem[@accessibilitylabel='Delivery']

You should not use indexes in XPaths if at all possible. You can take them out and Ranorex will usually still find the item within the timeout.
Shortcuts usually aren't...

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

Re: Randomness in the Repository

Post by stapes » Tue Nov 24, 2015 7:03 pm

Amazing - it works where I have an Accessibility Label. These aren't real Accessibility labels, but values in the field concerned.