what is best practice for web testing

Ranorex Studio, Spy, Recorder, and Driver.
User avatar
jkischel
Posts: 5
Joined: Wed Jun 08, 2022 7:55 am

what is best practice for web testing

Post by jkischel » Tue Aug 09, 2022 8:03 am

Hi folks,

I'm going to test a web frontend with Rx 9.5.3, but what is best practice for selecting the items?

my thoughts:
- Indexes like [1], [2], [3],... maybe reliable, but make the tests rather fragile.
- element ids are not possible in every way as this is a javascript application where the ids are named randomly and elements also might occur multiple times
- automationid as attribute, but somehow Ranorex Studio doesn't seem to support this. At least, in the spy I cannot select it in the editor even if they are present.
- also possible could be to use css pseudo classes, but this will make the code hard to maintain

So what exactly is best practice for selecting elements?
System information:
I'm using Ranorex v9.6.3 on a Windows 10 machine.