Re: Webdriver protocol. Locator strategies

On 4 Jul 2016, at 10:45, Miguel <> wrote:
> These locator strategies can be replicated but maybe for performance reasons, shouldn't be eliminated, because they can use document.getElementById and document.getElementsByName internally. Maybe these functions offer a better performance than document.querySelector or document.querySelectorAll.

Some rudimentary testing I did in Gecko showed that there is a notable performance penalty running document.querySelectorAll("a") vs. document.getElementsByTagName("a") on large documents, such as the HTML specification.

The first cold run tended to be the most penalised, and subsequent cached runs were less impacted. I saw similar tendencies in Blink.

This could be a bug with querySelectorAll. There were similar tendencies in Blink.

> At the same time, eliminating these locator strategies can break code of other users

The idea is that they can be patched in clients, so they would not break anyone’s code.

Received on Monday, 4 July 2016 15:00:01 UTC