/** * @return string * @throws WebDriverException */ public function getText() { try { return $this->element->getText(); } catch (WebDriverException $exception) { $this->dispatchOnException($exception); } }
/** * An helper function to ensure the new page is load after a click. * * @param WebDriverElement $webDriverElement the element to click. * * @return void */ public function clickToLoadNewPage($webDriverElement) { $webDriverElement->click(); try { while (true) { $webDriverElement->getText(); } } catch (StaleElementReferenceException $e) { return; } }