Web 2.0

Experiences, small talk, and other automation gossip.
Posts: 2
Joined: Fri Jun 14, 2019 10:48 am

Web 2.0

Post by jpb » Fri Jun 14, 2019 11:08 am

Hi all,

I'm not new to Ranorex GTA, but I'm new to this forum.
We bought Ranorex a couple of years back for automation of an application build with QT.
I must say that to automate this middlewear, there is nothing better than Ranorex.

I would like to ask the community about their experiences on testing on chrome/web 2.0 applications.
I've started to automate a web front-end with Angular 2+ to replace our old silverlight application.
The replay of scripts may work once just after recording, later on the scripts will not work any more.
Just looking at the repository items, identified with the typical /div structure .//div[#'rootLayout']/div/div[2]/div[2]/div/div/div[4]
they are no longer recognized because of changes of the indexes, div[3] instead of div[2] at the next run.
Sometimes is such complicated that havin highlighting selected, the control appears in the AUT selected with the red rectangle,
but once the test is launched the control can't be found at all.

It's kind of disappointing and I'm feeling like GTA makes no sense this way...
How do you guys go about solving this on your test beds?

Thanks a lot in advance for your time


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

Re: Web 2.0

Post by odklizec » Fri Jun 14, 2019 12:20 pm


My experience with Angular-based apps is, that one can forget about using Recording with Angular apps ;) Angular-based apps are a big mess of divs and and spans, where even such simple thing like checkbox, is not so simple thing in Angular :D I'm constructing all my Angular-based repo items manually, using tracking and manual editing of every single xpath.

At next, because of lack of sensible IDs in Angular elements, I'm frequently using Class attribute, which is, by default, ignored by Ranorex tracking/recording. Class attribute often contains very useful information, regarding purpose of individual angular elements. For this, I've modified xpath weight rules, to give the Class attribute higher priority. So Ranorex now constructs xpaths based of the class attributes, instead of random and pretty unstable indexes.

You can learn how to change the xpath weight rules here:
https://www.ranorex.com/blog/automated- ... namic-ids/
But even with Class attribute, you will have to manually edit almost every recorded/tracked xpath.

If you want more detailed help, please post a Ranorex snapshot (NOT screenshot) of your app under test and an example of problematic xpath. Thanks.
Last edited by odklizec on Fri Jun 14, 2019 1:36 pm, edited 3 times in total.
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

Posts: 2
Joined: Fri Jun 14, 2019 10:48 am

Re: Web 2.0

Post by jpb » Fri Jun 14, 2019 1:32 pm

Thanks a lot for confirmation Pavel :)
...will try with the class and rxPath next.

Best regards