I'm trying to catch errors in pages that timeout when running them with Facebook's PHP webdriver.
The page load and wait are both succesfully called, but the TimeOutException thrown by wait() doesn't get caught in either catch block.
try {
$this->webDriver->get(self::BASE_URI.$uri_to_check);
$this->webDriver->wait($webDriver, 100, 500)->until(
WebDriverExpectedCondition::titleIs('My Page'));
}
catch (TimeOutException $e) {
return "Timeout Exception because".$e->getMessage();
}
catch (Exception $e) {
return "Failed to load page because".$e->getMessage();
}
How can I catch this?