diff --git a/src/lib/Browser/Element/Element.php b/src/lib/Browser/Element/Element.php index 30218d5c..419ba505 100644 --- a/src/lib/Browser/Element/Element.php +++ b/src/lib/Browser/Element/Element.php @@ -10,12 +10,12 @@ use Behat\Mink\Element\NodeElement; use Behat\Mink\Session; +use Facebook\WebDriver\Exception\NoSuchElementException; +use Facebook\WebDriver\Exception\StaleElementReferenceException; use Ibexa\Behat\Browser\Assert\ElementAssert; use Ibexa\Behat\Browser\Assert\ElementAssertInterface; use Ibexa\Behat\Browser\Element\Factory\ElementFactoryInterface; use Ibexa\Behat\Browser\Locator\LocatorInterface; -use Webdriver\Exception\NoSuchElement; -use WebDriver\Exception\StaleElementReference; final class Element extends BaseElement implements ElementInterface { @@ -33,9 +33,9 @@ public function isVisible(): bool { try { return $this->decoratedElement->isVisible(); - } catch (StaleElementReference $e) { + } catch (NoSuchElementException $element) { return false; - } catch (NoSuchElement $element) { + } catch (StaleElementReferenceException $e) { return false; } }