Answers for "choosing locator"

2

choose locator

--> How do you decide which locator to use? Which one is the most 
important locator?
    #1-> If it is a link, I would go for linkText.
    
    #2-> If there is id, I will use id value to locate
    (after making sure it is not dynamic)
    
    #3-> If there is class, I'll quickly check if it is unique or not?
   
   #4-> If none of the others are not working, then I would 
   create my custom locator with XPATH (or cssSelector)
Posted by: Guest on December-04-2020

Code answers related to "choosing locator"

Browse Popular Code Answers by Language