Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve eficciency of NonEmptyNavigator's constructor for larger collections of web elements #223
Originally created by Marcin Erdmann.
Due to the fact that in the constructor of NonEmptyNavigator we're calling unique() on the collection of webelements passed in it means that we're comparing each element with all the others. It turns out that the equals() implementation of RemoteWebElement sends a command to the browser to get the result of the comparison which is quite a time consuming thing to do. So if our selector passed to $/find returns 25 elements we will do 300 more calls to the remote browser to make sure that we have no duplicates, which means that creating the navigator will most probably take over a second!