Skip to content

Commit

Permalink
Better integration with PHPUnit when an element is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
chibimagic committed Apr 16, 2014
1 parent f8821da commit 593595a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion WebDriver/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion WebDriver/NoSuchElementException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php

class WebDriver_NoSuchElementException extends Exception {
class WebDriver_NoSuchElementException extends PHPUnit_Framework_ExpectationFailedException {
}

0 comments on commit 593595a

Please sign in to comment.