When i used the listed method to see whether an element is visible on the page, I get an exception stating that its **unable to locate an element using the specified locator.** 

Any ideas, has anyone faced this issue before or even have a better method? 

```
    public boolean isElementPresentByWebElement(WebElement element) {
    Wait<WebDriver> fluentWait = new FluentWait<WebDriver>(driver).withTimeout(15, TimeUnit.SECONDS)
            .pollingEvery(1, TimeUnit.SECONDS).ignoring(NoSuchElementException.class);

    for (int i = 0; i < 2; i++) {
        try {
            fluentWait.until(ExpectedConditions.visibilityOf(element));
            System.out.println("Element is visible: " + element.toString());
            return true;
        } catch (Exception e) {
            System.out.println(
                    "Unable to locate the element: " + element.toString() + ", Exception: " + e.toString());
            throw (e);
        }
    }
    return false;
}

```

[![enter image description here](https://i.stack.imgur.com/sifTl.jpg)](https://i.stack.imgur.com/sifTl.jpg)