Xpath type locator for the Login input

Viewed 27

I want to understand this but I am kinda confused:

Taking the following login as an example, if we want to identify an xpath type locator for the Login input, what would it be the most appropriate option as a good practice. Note that all of these options work correctly when locating the Login (input) object.

Image:

Image

Can someone help me out?

1 Answers

Among the following suggestions:

suggestions

The most canonical locator strategy would be option b:

//input[@id='user_login']
Related