Checks if the provided element is present on the page based on the locator provided

@param locator
String that represents the means to locate this element (could be id/name/xpath/css locator).
@return boolean indicating if the element was found.
978695
public static boolean isElementPresent(String locator) {
        logger.entering(locator);
        boolean flag = false;
        try {
            flag = HtmlElementUtils.locateElement(locator) != null;
        } catch (NoSuchElementException e) { // NOSONAR
        }
        logger.exiting(flag);
        return flag;
    }
395943
public boolean contains(final T element) {
        if (element == null) {
            return false;
        }
        return comparator.compare(element, minimum) > -1 && comparator.compare(element, maximum) < 1;
    }
1243401
public void click(String locator) {
        getDispatcher().beforeClick(this, locator);
        
        getElement().click();
        validatePresenceOfAlert();
        if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
            logUIAction(UIActions.CLICKED);
        }
        WebDriverWaitUtils.waitUntilElementIsPresent(locator);
        
        getDispatcher().afterClick(this, locator);
    }
761719
def isElement(self, node, name, nsuri=None):
        """"""
        if node.nodeType != node.ELEMENT_NODE:
            return 0
        return node.localName == name and \
               (nsuri is None or self.nsUriMatch(node.namespaceURI, nsuri))
1356234
def asset_element_present(self, locator, msg=None):
        
        e = driver.find_elements_by_locator(locator)
        if len(e) == 0:
            raise AssertionError("Element at %s was not found" % locator)
610831
private boolean isElementPresent_internal() throws WidgetException {
		try {
			try {
			    final boolean isPotentiallyXpathWithLocator =
			            (locator instanceof EByFirstMatching) || (locator instanceof EByXpath);  
				if (isPotentiallyXpathWithLocator && isElementPresentJavaXPath())
					return true;
			} catch (Exception e) {
				// Continue
			}

			findElement();
			return true;
		} catch (NoSuchElementException e) {
			return false;
		}
	}
626507
public void mouseHoverOverElement(By locator) {
        SynchronisationService synchronisationService = new SynchronisationService();

        synchronisationService.waitAndAssertForExpectedCondition(ExpectedConditions.visibilityOfElementLocated(locator));

        WebElement element = getWebDriver().findElement(locator);
        Actions builder = new Actions(getWebDriver());
        Actions hoverOverRegistrar = builder.moveToElement(element);
        hoverOverRegistrar.perform();
    }
1262185
def page_should_contain_element(self, locator, loglevel='INFO'):
        
        if not self._is_element_present(locator):
            self.log_source(loglevel)
            raise AssertionError("Page should have contained element '%s' "
                                 "but did not" % locator)
        self._info("Current page contains element '%s'." % locator)
95965
public static ExpectedCondition<List<WebElement>> presenceOfAllElementsLocatedBy(
    final By locator) {
    return new ExpectedCondition<List<WebElement>>() {
      @Override
      public List<WebElement> apply(WebDriver driver) {
        List<WebElement> elements = driver.findElements(locator);
        return elements.size() > 0 ? elements : null;
      }

      @Override
      public String toString() {
        return "presence of any elements located by " + locator;
      }
    };
  }
823388
public static Matcher<JsonElement> isElementValid(final Validator validator, final JsonElement element) {
        return new TypeSafeDiagnosingMatcher<JsonElement>() {
            @Override
            protected boolean matchesSafely(JsonElement item, Description mismatchDescription) {
                if (!validator.isValid(element)) {
                    mismatchDescription.appendText("element: " + element.toString() + ", does not validate by validator " + validator.getTitle());
                    return false;
                }
                return true;
            }

            @Override
            public void describeTo(Description description) {
                description.appendText("is array item valid");
            }
        };
    }
137462
public static ExpectedCondition<List<WebElement>> presenceOfNbElementsLocatedBy(final By locator, final int nb) {
        return new ExpectedCondition<List<WebElement>>() {
            @Override
            public List<WebElement> apply(WebDriver driver) {
                final List<WebElement> elements = driver.findElements(locator);
                return elements.size() == nb ? elements : null;
            }
        };
    }
284703
def assert_visible(self, locator, msg=None):
        
        e = driver.find_elements_by_locator(locator)
        if len(e) == 0:
            raise AssertionError("Element at %s was not found" % locator)
        assert e.is_displayed()
1231668
public function hasUncheckedField($locator)
    {
        $field = $this->findField($locator);

        return null !== $field && !$field->isChecked();
    }
1258927
public static void waitUntilElementIsPresent(final String elementLocator) {
        logger.entering(elementLocator);
        By by = HtmlElementUtils.resolveByType(elementLocator);
        ExpectedCondition<WebElement> condition = ExpectedConditions.presenceOfElementLocated(by);
        waitForCondition(condition);
        logger.exiting();
    }
934109
public By defineByElement() {
        // consider adding strengthening
        By byElement = null;
        switch (type) { // determine which locator type we are interested in
            case XPATH:
                byElement = By.xpath(locator);
                break;
            case ID:
                byElement = By.id(locator);
                break;
            case NAME:
                byElement = By.name(locator);
                break;
            case CLASSNAME:
                byElement = By.className(locator);
                break;
            case CSS:
                byElement = By.cssSelector(locator);
                break;
            case LINKTEXT:
                byElement = By.linkText(locator);
                break;
            case PARTIALLINKTEXT:
                byElement = By.partialLinkText(locator);
                break;
            case TAGNAME:
                byElement = By.tagName(locator);
                break;
        }
        return byElement;
    }
140303
public boolean containsElement(Element element) {
        String deepName = getDeepName(element);
        return elementNameSortOrderMap.containsKey(deepName);
    }
587774
public function hasCheckedField($locator)
    {
        $field = $this->findField($locator);

        return null !== $field && $field->isChecked();
    }