Page 1 of 1

Simple rules for enabling au

Posted: Mon Mar 06, 2017 3:42 pm
by gvrachliotis
One common situation in almost every ranorex project I have worked with is automation not working after a few new software releases, because e.g. a menu button changed position or order etc. I mainly write automated test cases for Web UIs and web apps. When creating my repository I always try to track items with a combination of attributes that are unlikely to change e.g. name or id html attributes, but in many cases attributes like these do not exist. If you could present developers a list with best practices to introduce in their code, which will enable automation testing for the long run, what would you include in the list, e.g. id attribute in all html tags? Thanks.

Re: Simple rules for enabling au

Posted: Wed Mar 15, 2017 8:59 am
by odklizec
Hi,

Well, I'm afraid, there is no, and never will be a perfect solution of this problem. We will always have to update our tests from time to time.

Basically, your developers should not forget to add unique IDs or at least reasonable "accessible name" strings to the critical GUI elements.

At your side, you should avoid using element indexes at any cost! These are least stable attributes and should not be used, unless there is absolutely no other way. Instead of using element indexes, try to reference the elements using neighboring/parent elements (labels, cells, etc). Eventually, in case of tables, which typically don't have IDs for individual cells, use childindexes, obtained from table header columns.