MDL-40690 behat: Ignore StaleElementReference exception
Is another of the exceptions thrown by Selenium when it tries to interact with an element that disappeared from the DOM, in happens randomly when redirecting the user to another page with a wait period to show him/her a message.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user