Zhimin Zhan
Feb 5, 2022

--

I use locator based on the three rules:

1. less likely to change

2. meaningful

3. fast

In your example, if the element has no meaningful ID or NAME, then @data-qa-selector='login_field' is a good one.

--

--

Zhimin Zhan
Zhimin Zhan

Written by Zhimin Zhan

Test automation & CT coach, author, speaker and award-winning software developer. Help teams succeed with Agile/DevOps by implementing real Continuous Testing.

No responses yet