Skip to main content
cleanup
Source Link
c32hedge
  • 2.7k
  • 19
  • 39

Finding elements by ID is fastest option, because it eventually calls document.getElementById(), which is optimized by most browsers.

One can make the same argument about text being changed, same with cssCSS selectors, if you are working on a product that is under development; you can not guarantee that things wontwon't change.

CssCSS selectors/Name are second fastest, then comes XPath, css. CSS selectors are awesome but not as flexible that xpath.

Hope this helpsas XPath.

Finding elements by ID is fastest option, because it eventually calls document.getElementById(), which is optimized by most browsers.

One can make the same argument about text being changed, same with css selectors, if you are working on a product that is under development; you can not guarantee that things wont change.

Css selectors/Name are second fastest then comes XPath, css selectors are awesome but not as flexible that xpath.

Hope this helps.

Finding elements by ID is fastest option, because it eventually calls document.getElementById(), which is optimized by most browsers.

One can make the same argument about text being changed, same with CSS selectors, if you are working on a product that is under development; you can not guarantee that things won't change.

CSS selectors/Name are second fastest, then comes XPath. CSS selectors are awesome but not as flexible as XPath.

Source Link

Finding elements by ID is fastest option, because it eventually calls document.getElementById(), which is optimized by most browsers.

One can make the same argument about text being changed, same with css selectors, if you are working on a product that is under development; you can not guarantee that things wont change.

Css selectors/Name are second fastest then comes XPath, css selectors are awesome but not as flexible that xpath.

Hope this helps.