lib/WebDriverExpectedCondition.php
public static function visibilityOfElementLocated(WebDriverBy $by)
    {
        return new static(
            function (WebDriver $driver) use ($by) {
                try {
                    $element = $driver->findElement($by);

                    return $element->isDisplayed() ? $element : null;
                } catch (StaleElementReferenceException $e) {
                    return null;
                }
            }
        );
    }
public static function visibilityOfElementLocated(WebDriverBy $by)
    {
        return new static(
            function (WebDriver $driver) use ($by) {
                try {
                    $element = $driver->findElement($by);

                    return $element->isDisplayed() ? $element : null;
                } catch (StaleElementReferenceException $e) {
                    return null;
                }
            }
        );
    }
public static function visibilityOfElementLocated ( WebDriverBy $ by ) { return new static ( function ( WebDriver $ driver ) use ( $ by ) { try { $ element = $ driver -> findElement ( $ by ) ; return $ element -> isDisplayed ( ) ? $ element : null ; } catch ( StaleElementReferenceException $ e ) { return null ; } } ) ; }
An expectation for checking that an element is present on the DOM of a page and visible.
Visibility means that the element is not only displayed but also has a height and width that is greater than 0.

@param WebDriverBy $by The locator used to find the element.
@return static Condition returns the WebDriverElement which is located and visible.
An expectation for checking that an element is present on the DOM of a page and visible . Visibility means that the element is not only displayed but also has a height and width that is greater than 0 .