Which Selenium WebDriver locator is faster?

Zhimin Zhan
3 min readJan 27, 2021

According to this article on Medium: “Which locator is faster in identifying elements in Selenium?”, the order of Selenium Locators (fast to slow) is “ID, Name, CSS, XPath”.

Today I did a benchmark test to compare those 4 Selenium locators, I got quite different results. As we know, the time took to identify one web element is very much dependent on the page content. There are many…

--

--

Zhimin Zhan

Test automation & CT coach, author, speaker and award-winning software developer. Help teams succeed with Agile/DevOps by implementing real Continuous Testing.