📜  选择定位器 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:30.204000             🧑  作者: Mango

代码示例1
--> 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)