Page 1 of 1

Randomness in the Repository

Posted: Tue Nov 24, 2015 4:13 pm
by stapes
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.

Re: Randomness in the Repository

Posted: Tue Nov 24, 2015 5:47 pm
by krstcs
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.

Re: Randomness in the Repository

Posted: Tue Nov 24, 2015 7:03 pm
by stapes
Amazing - it works where I have an Accessibility Label. These aren't real Accessibility labels, but values in the field concerned.