code: public static List<WebElement> locateElements(String locator) {
          logger.entering(locator);
          Preconditions.checkArgument(StringUtils.isNotBlank(locator), INVALID_LOCATOR_ERR_MSG);
          By locatorBy = resolveByType(locator);
          RemoteWebDriver rwd = (RemoteWebDriver) Grid.driver();
          List<WebElement> webElementsFound = rwd.findElements(locatorBy);
  
          // if element is empty list then throw exception since unlike
          // findElement() findElements() always returns a list
          // irrespective of whether an element was found or not
          if (webElementsFound.isEmpty()) {
              throw new NoSuchElementException("Cannot locate any element using [" + locatorBy + "]");
          }
          logger.exiting(webElementsFound);
          return webElementsFound;
      }
docs: Parses locator string to identify the proper By subclass before calling Selenium
  {@link WebElement#findElements(By)} to locate the web elements.
  
  @param locator
  String that represents the means to locate this element (could be id/name/xpath/css locator).
  
  @return {@link WebElement} list that represents the html elements that was located using the locator provided.