UI Automation Out of Control

Ask general questions here.
User avatar
sincoew
Posts: 48
Joined: Mon Nov 19, 2012 7:42 am

UI Automation Out of Control

Post by sincoew » Wed May 29, 2013 8:26 am

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.

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

Re: UI Automation Out of Control

Post by odklizec » Wed May 29, 2013 9:11 am

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? ;)
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
sincoew
Posts: 48
Joined: Mon Nov 19, 2012 7:42 am

Re: UI Automation Out of Control

Post by sincoew » Fri May 31, 2013 8:09 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: UI Automation Out of Control

Post by Support Team » Fri May 31, 2013 8:26 am

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

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

Re: UI Automation Out of Control

Post by odklizec » Fri May 31, 2013 9:04 am

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?
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
sincoew
Posts: 48
Joined: Mon Nov 19, 2012 7:42 am

Re: UI Automation Out of Control

Post by sincoew » Fri Jun 14, 2013 3:20 am

Thanks a lot.
I will try to improve.

Best Regards,
Sincoew