Filters out non-displayed elements.
@param webElement element to check.
@return webElement if it is displayed, null otherwise.
7732
@Override
    public T apply(T webElement) {
        if (firstFound == null) {
            firstFound = webElement;
        }
        return mayPass(webElement) ? webElement : null;
    }
597144
public boolean checked() {
        boolean isChecked = false;
        try {
            isChecked = element.getWebElement().isSelected();
        } catch (Exception e) {
            log.info(e);
        }
        return isChecked;
    }
244758
public String value() {
        if (!element.is().present() || !element.is().input()) {
            return null;
        }
        WebElement webElement = element.getWebElement();
        return webElement.getAttribute(VALUE);
    }
832466
function excludeElements(exclude) {
      return Array.isArray(exclude) ? exclude.forEach(function(selector) {
        // Use querySelectorAll to hide all dom element with the specified selector
        var selectorAll = document.querySelectorAll(selector);

        if(selectorAll.length) {
          // Interate through NodeList
          for(var i = 0; i < selectorAll.length; i++) {
            selectorAll.item(i).style.visibility = 'hidden';
          }
        }
      }) : false;
    }
189200
public static void waitUntilElementIsVisible(final String elementLocator) {
        logger.entering(elementLocator);
        By by = HtmlElementUtils.resolveByType(elementLocator);
        ExpectedCondition<WebElement> condition = ExpectedConditions.visibilityOfElementLocated(by);
        waitForCondition(condition);
        logger.exiting();
    }
99528
public RemoveInfo addElement(TreeElement elem)
    {
        // if the attributes are empty then there is nothing to add to lists
        ArrayList attrs = elem.getAttributeList();
        if (attrs == null || attrs.size() == 0)
            return emptyRemoves;

        // We will track all of the elements that we are removing from the current inheritence
        // list set and return those back to the caller to stash away on the stack.
        RemoveInfo removes = _removes;
        if (removes == null)
            removes = new RemoveInfo();

        // walk all of the attributes
        int cnt = attrs.size();
        assert (cnt > 0);
        for (int i = 0; i < cnt; i++) {
            TreeHtmlAttributeInfo attr = (TreeHtmlAttributeInfo) attrs.get(i);
            if (attr.isOnDiv()) {
                addAttribute(TreeHtmlAttributeInfo.HTML_LOCATION_DIV, attr, removes);
            }
            if (attr.isOnIcon()) {
                addAttribute(TreeHtmlAttributeInfo.HTML_LOCATION_ICON, attr, removes);
            }
            if (attr.isOnSelectionLink()) {
                addAttribute(TreeHtmlAttributeInfo.HTML_LOCATION_SELECTION_LINK, attr, removes);
            }
        }

        // if we didn't remove anything then we should simply stash the array list away for next time
        // and return null.
        if (removes.removes.size() == 0) {
            _removes = removes;
            removes = null;
        }
        else {
            _removes = null;
        }

        return removes;
    }
1106412
@Override
	public List<WebElement> findElements(final By by) {
		return wef.by(by).findAll();
	}
952311
static Elements filterOut(Collection<Element> elements, Collection<Element> outs) {
        Elements output = new Elements();
        for (Element el : elements) {
            boolean found = false;
            for (Element out : outs) {
                if (el.equals(out)) {
                    found = true;
                    break;
                }
            }
            if (!found)
                output.add(el);
        }
        return output;
    }
1232647
@When("^I de-select every item on the element on index '(\\d+?)'$")
    public void elementDeSelect(Integer index) {
        Select sel = null;
        sel = new Select(commonspec.getPreviousWebElements().getPreviousWebElements().get(index));

        if (sel.isMultiple()) {
            sel.deselectAll();
        }
    }
631219
@Nullable final TypeElement classElementFor(Element element) {
        while (element != null && !(JavaModelUtils.isClassOrInterface(element) || JavaModelUtils.isEnum(element))) {
            element = element.getEnclosingElement();
        }
        if (element instanceof  TypeElement) {
            return (TypeElement) element;
        }
        return null;
    }
468627
public static ExpectedCondition<Boolean> elementSelectionStateToBe(final WebElement element,
                                                                     final boolean selected) {
    return new ExpectedCondition<Boolean>() {
      @Override
      public Boolean apply(WebDriver driver) {
        return element.isSelected() == selected;
      }

      @Override
      public String toString() {
        return String.format("element (%s) to %sbe selected", element, (selected ? "" : "not "));
      }
    };
  }
788586
public static void removeChildrenFrom(Element element) {
        if (element != null) {
            while (element.firstChild != null) {
                element.removeChild(element.firstChild);
            }
        }
    }
1372927
public static void removeChildrenFrom(final Element element) {
        if (element != null) {
            while (element.getFirstChild() != null) {
                element.removeChild(element.getFirstChild());
            }
        }
    }
1336083
public boolean displayed() {
        boolean isDisplayed = false;
        try {
            isDisplayed = element.getWebElement().isDisplayed();
        } catch (NoSuchElementException e) {
            log.info(e);
        }
        return isDisplayed;
    }
575681
public HtmlElement findHtmlElementById(String elementId) {
        try {
            return htmlPage.getHtmlElementById(elementId);
        } catch (ElementNotFoundException e) {
            return null;
        }
    }
191038
protected static String getElement(JWTPayload payload, String element) {
        String output = null;
        if (payload != null) {
            Object outObj = payload.get(element);
            if (outObj instanceof String) {
                output = (String) outObj;
            } else if (outObj instanceof List) {
                if (((List<String>) outObj).size() == 1) {
                    output = ((List<String>) outObj).get(0);
                }
                // if there are multiple values, return null.
            }
        }
        return output;
    }
659699
ElemTemplateElement getElemTemplateElement()
  {

    try
    {
      return (ElemTemplateElement) m_elems.peek();
    }
    catch (java.util.EmptyStackException ese)
    {
      return null;
    }
  }