/**
  * @return bool
  * @throws WebDriverException
  */
 public function isEnabled() {
   try {
     return $this->element->isEnabled();
   } catch (WebDriverException $exception) {
     $this->dispatchOnException($exception);
   }
 }
 /**
  * Wait until an element is no longer attached to the DOM.
  *
  * @param WebDriverElement $element The element to wait for.
  * @return WebDriverExpectedCondition<bool> false if the element is still
  *         attached to the DOM, true otherwise.
  */
 public static function stalenessOf(WebDriverElement $element)
 {
     return new WebDriverExpectedCondition(function ($driver) use($element) {
         try {
             $element->isEnabled();
             return false;
         } catch (StaleElementReferenceException $e) {
             return true;
         }
     });
 }
 /**
  * Wait until an element is no longer attached to the DOM.
  *
  * @param WebDriverElement $element The element to wait for.
  * @return bool false if the element is still attached to the DOM, true
  *              otherwise.
  */
 public static function stalenessOf(WebDriverElement $element) {
   return new WebDriverExpectedCondition(
     function ($driver) use ($element) {
       try {
         $element->isEnabled();
         return false;
       } catch (ObsoleteElementWebDriverError $e) {
         return true;
       }
     }
   );
 }