Question: what are the different types of locators in selenium which one is preferable to use?
Answer: id Locator: The most preferable way to locate an element in the webpage is locating By id. ... 
name Locator: If id is not available for any element. ... 
Linktext Locator: As it name says, we can locate any link By its text with the help of Linktext locator.