From 593595aa5b098a4c4c9ae0737f6a769adbb0d441 Mon Sep 17 00:00:00 2001 From: chibimagic Date: Wed, 16 Apr 2014 14:06:06 -0700 Subject: [PATCH] Better integration with PHPUnit when an element is not found --- WebDriver/Driver.php | 2 +- WebDriver/NoSuchElementException.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WebDriver/Driver.php b/WebDriver/Driver.php index bdabca7..fabecab 100644 --- a/WebDriver/Driver.php +++ b/WebDriver/Driver.php @@ -119,7 +119,7 @@ public function execute($http_type, $relative_url, $payload = null) { $response_info = $response_status_code . " - " . self::$status_codes[$response_status_code][0] . " - " . self::$status_codes[$response_status_code][1]; $additional_info = isset($response_json['value']['message']) ? "Message: " . $response_json['value']['message'] : "Response: " . $response['body']; if ($response_status_code == 7) { - throw new WebDriver_NoSuchElementException(); + throw new WebDriver_NoSuchElementException("Could not find element: " . print_r($payload, true)); } if ($response_status_code == 10) { throw new WebDriver_StaleElementReferenceException(); diff --git a/WebDriver/NoSuchElementException.php b/WebDriver/NoSuchElementException.php index d6b1f7a..86efde0 100644 --- a/WebDriver/NoSuchElementException.php +++ b/WebDriver/NoSuchElementException.php @@ -1,4 +1,4 @@