Home > Back-end >  Xpath type locator for the Login input
Xpath type locator for the Login input

Time:02-04

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?

CodePudding user response:

Among the following suggestions:

suggestions

The most canonical locator strategy would be option b:

//input[@id='user_login']
  •  Tags:  
  • Related