Skip to content

Commit 68bd128

Browse files
authored
Updated WebDriver exception handling (#121)
WebDriverCurlException was moved to Internal namespace and deprecated in php-webdriver/webdriver 1.14
1 parent 5cda403 commit 68bd128

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"codeception/codeception": "^5.0.8",
2626
"codeception/lib-web": "^1.0.1",
2727
"codeception/stub": "^4.0",
28-
"php-webdriver/webdriver": "^1.8.0",
28+
"php-webdriver/webdriver": "^1.14.0",
2929
"phpunit/phpunit": "^10.0 || ^11.0"
3030
},
3131
"suggest": {

src/Codeception/Module/WebDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
use Exception;
3636
use Facebook\WebDriver\Cookie;
3737
use Facebook\WebDriver\Cookie as WebDriverCookie;
38+
use Facebook\WebDriver\Exception\Internal\UnexpectedResponseException;
3839
use Facebook\WebDriver\Exception\InvalidElementStateException;
3940
use Facebook\WebDriver\Exception\InvalidSelectorException;
4041
use Facebook\WebDriver\Exception\NoSuchElementException;
4142
use Facebook\WebDriver\Exception\UnknownErrorException;
42-
use Facebook\WebDriver\Exception\WebDriverCurlException;
4343
use Facebook\WebDriver\Interactions\WebDriverActions;
4444
use Facebook\WebDriver\Remote\LocalFileDetector;
4545
use Facebook\WebDriver\Remote\RemoteWebDriver;
@@ -1688,7 +1688,7 @@ public function _initializeSession(): void
16881688

16891689
$this->setBaseElement();
16901690
$this->initialWindowSize();
1691-
} catch (WebDriverCurlException $exception) {
1691+
} catch (UnexpectedResponseException $exception) {
16921692
codecept_debug('Curl error: ' . $exception->getMessage());
16931693
throw new ConnectionException(
16941694
"Can't connect to WebDriver at {$this->wdHost}."

0 commit comments

Comments
 (0)