Skip to content

Commit 897e7d7

Browse files
authored
Merge pull request #380 from aik099/selenium3-timeout-fix
Improve "Selenium2Driver::applyTimeouts" error handling for Selenium 3 support
2 parents a56db27 + 2fe6b36 commit 897e7d7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/Selenium2Driver.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Behat\Mink\KeyModifier;
1515
use Behat\Mink\Selector\Xpath\Escaper;
1616
use WebDriver\Element;
17+
use WebDriver\Exception\InvalidArgument;
1718
use WebDriver\Exception\NoSuchElement;
1819
use WebDriver\Exception\StaleElementReference;
1920
use WebDriver\Exception\UnknownCommand;
@@ -372,6 +373,10 @@ private function applyTimeouts(): void
372373
$this->getWebDriverSession()->timeouts($type, $param);
373374
}
374375
} catch (UnknownError $e) {
376+
// Selenium 2.x.
377+
throw new DriverException('Error setting timeout: ' . $e->getMessage(), 0, $e);
378+
} catch (InvalidArgument $e) {
379+
// Selenium 3.x.
375380
throw new DriverException('Error setting timeout: ' . $e->getMessage(), 0, $e);
376381
}
377382
}

0 commit comments

Comments
 (0)