lib/WebDriverExpectedCondition.php
public static function frameToBeAvailableAndSwitchToIt($frame_locator)
    {
        return new static(
            function (WebDriver $driver) use ($frame_locator) {
                try {
                    return $driver->switchTo()->frame($frame_locator);
                } catch (NoSuchFrameException $e) {
                    return false;
                }
            }
        );
    }
public static function frameToBeAvailableAndSwitchToIt($frame_locator)
    {
        return new static(
            function (WebDriver $driver) use ($frame_locator) {
                try {
                    return $driver->switchTo()->frame($frame_locator);
                } catch (NoSuchFrameException $e) {
                    return false;
                }
            }
        );
    }
public static function frameToBeAvailableAndSwitchToIt ( $ frame_locator ) { return new static ( function ( WebDriver $ driver ) use ( $ frame_locator ) { try { return $ driver -> switchTo ( ) -> frame ( $ frame_locator ) ; } catch ( NoSuchFrameException $ e ) { return false ; } } ) ; }
Expectation for checking if iFrame exists. If iFrame exists switches driver's focus to the iFrame.

@param string $frame_locator The locator used to find the iFrame
expected to be either the id or name value of the i/frame
@return static Condition returns object focused on new frame when frame is found, false otherwise.
Expectation for checking if iFrame exists . If iFrame exists switches driver s focus to the iFrame .