Page 1 of 1

UI Automation Out of Control

Posted: Wed May 29, 2013 8:26 am
by sincoew
Hi

In my work, I write UI Test Automation on android app,
I write much test case, (156 count)
but when android app release, I see android UI structure(xml) has substantially modified,
my test case all fail in this version.

I have a question, It's UI Test Automation is really can do?
Has anyone do UI Test Automation, it's success on real world?

Best Regard.

Re: UI Automation Out of Control

Posted: Wed May 29, 2013 9:11 am
by odklizec
I think that the UI automation works quite well with the Ranorex. The crucial point is to design your test cases (and clean up the repository) in the way that they are prone to UI changes. For example, use the reg. expressions and well organized repository with relative paths. Also, try reduce the number of hardcoded values and replace them with variables where possible, co they are easy to change. I'm sure, other users will come with some other ideas? ;)

Re: UI Automation Out of Control

Posted: Fri May 31, 2013 8:09 am
by sincoew
Hi odklizec,

some repository I use relative path to get value,
For example,

Code: Select all

String Str= ListView.Children[0].Children[3].Element.getvalue;
The Xml structure on old version:

-ListView

Code: Select all

- Children[0]
   +Children[0]
   +Children[1]
   -Children[2]
        Element <-- Target
+ Children[1]
+ Children[2]
But on new version xml structure was change:

Code: Select all

-ListView
-Container
  - Children[0]
     -Container
         +Children[0]
     -Container
         +Children[1]
     -Container
         -Children[2]
              Element <-- Target
  + Children[1]
  + Children[2]
In this case, has any solution to avoid test case fail ?

Best Regards

Re: UI Automation Out of Control

Posted: Fri May 31, 2013 8:26 am
by Support Team
sincoew wrote:In this case, has any solution to avoid test case fail ?
Well, the simple recommendation is: Don't use indices unless absolutely necessary. Meaning that you should rather look for a unique attribute in order to identify the children in your case.

Ranorex also provides a few handy RanoreXPath operators that allow making paths more flexible and robust to future changes. I.e. if you suspect new levels to be added to the UI structure in the future, you can add the "//" or "/?/" operators at those places.
Just be careful about placing those operators, because using them makes the RanoreXPath less restrictive and searches can take longer.

See the following topic in the Ranorex User Guide for additional info:
http://www.ranorex.com/support/user-gui ... html#c3296

Regards,
Alex
Ranorex Team

Re: UI Automation Out of Control

Posted: Fri May 31, 2013 9:04 am
by odklizec
If you extensively use Ranorex Recorder, take a look at this Ranorex blog article...
http://www.ranorex.com/blog/automated-t ... ynamic-ids

The main part of the article describes how to deal with the dynamic controls. It also describes, how to change or create custom weight rules. With custom defined weight rules, Ranorex recorder will primarily use the attributes with higher (your defined) priority. Hope this helps?

Re: UI Automation Out of Control

Posted: Fri Jun 14, 2013 3:20 am
by sincoew
Thanks a lot.
I will try to improve.

Best Regards,
Sincoew