Skip to content

Commit 1ad9105

Browse files
committed
Fixed Bug that selenium tests are marked as failed if selenium server is not running
See giorgiosironi#94
1 parent 7c1a102 commit 1ad9105

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

PHPUnit/Extensions/SeleniumTestCase.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,13 @@ protected function onNotSuccessfulTest(Exception $e)
10861086
{
10871087
$this->restoreSessionStateAfterFailedTest();
10881088

1089-
$buffer = 'Current URL: ' . $this->drivers[0]->getLocation() .
1089+
try {
1090+
$url = $this->drivers[0]->getLocation();
1091+
} catch (\Exception $__e) {
1092+
$url = '<Error while loading URL>';
1093+
}
1094+
1095+
$buffer = 'Current URL: ' . $url .
10901096
"\n";
10911097

10921098
if ($this->captureScreenshotOnFailure) {

0 commit comments

Comments
 (0)