mardi 3 novembre 2015

Identifying Elements Effectively - AngularJS Automation with Ranorex

I have a relatively big web app is written in AngularJS. Our automation is using Ranorex to run BDD tests.

We are in a constant dilemma on how to enable the Ranorex tests to find UI elements effectively. Currently we're mainly using a custom attribute for it, testid (e.g. <div testid="done_btn">), but in some cases it performs very poorly, not sure whether it's because the querying XPaths aren't optimized or some other Ranorex configuration.

Using the id attribute is way faster but it just doesn't feel right to use it for automation. Besides, keeping it unique might require some coding in some cases (e.g. when using ng-repeat).

Is using id just for automation purposes OK or is it a bad practice? Why?

Any way to make Ranorex relate to custom attributes such as testid differently so that it'll be found faster? I've read about Ranorex Weight Rule but couldn't find a way to define custom attributes.

Aucun commentaire:

Enregistrer un commentaire