Defending against chromedriver that sometimes returns null value as the result of findElements operation. See
import java.net.URL;
import java.util.Collection;
+import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.LinkedHashSet;
@@ -442,6 +443,9 @@ protected void setFoundBy(SearchContext context, WebElement element, String by,
Response response = execute(DriverCommand.FIND_ELEMENTS,
ImmutableMap.of("using", by, "value", using));
Object value = response.getValue();
+ if (value == null) { // see https://github.com/SeleniumHQ/selenium/issues/4555
+ return Collections.emptyList();
+ }
List<WebElement> allElements;
try {
allElements = (List<WebElement>) value;
