Which is the best and fastest way to find the element using webdriver? By.XPath or By.ID or anything else? And why?

Viewed 34325

Which is the best and fastest way to find the element using webdriver? By.XPath or By.ID or anything else? And why?

I have read at many places that XPath is the right candidate but just could not find the accurate reason for that.

3 Answers
Related