diff --git a/lib/tests/behat/behat_general.php b/lib/tests/behat/behat_general.php index f15e5f66d61..d7e0ffbde9d 100644 --- a/lib/tests/behat/behat_general.php +++ b/lib/tests/behat/behat_general.php @@ -30,7 +30,8 @@ require_once(__DIR__ . '/../../behat/behat_base.php'); use Behat\Mink\Exception\ExpectationException as ExpectationException, Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException, Behat\Mink\Exception\DriverException as DriverException, - WebDriver\Exception\NoSuchElement as NoSuchElement; + WebDriver\Exception\NoSuchElement as NoSuchElement, + WebDriver\Exception\StaleElementReference as StaleElementReference; /** * Cross component steps definitions. @@ -84,6 +85,8 @@ class behat_general extends behat_base { $content = $metarefresh->getAttribute('content'); } catch (NoSuchElement $e) { return false; + } catch (StaleElementReference $e) { + return false; } // Getting the refresh time and the url if present.