Skip to content

Commit 5944f58

Browse files
committed
Mark a driver as started before applying configured timeouts
If applying the timeouts fails, the webdriver session is already opened, and may need to be closed for proper cleanup. But Mink won't close it if the driver does not consider itself as started.
1 parent 0fe1849 commit 5944f58

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/Selenium2Driver.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,15 +299,13 @@ public function start()
299299
{
300300
try {
301301
$this->wdSession = $this->webDriver->session($this->browserName, $this->desiredCapabilities);
302-
$this->applyTimeouts();
303302
} catch (\Exception $e) {
304303
throw new DriverException('Could not open connection: '.$e->getMessage(), 0, $e);
305304
}
306305

307-
if (!$this->wdSession) {
308-
throw new DriverException('Could not connect to a Selenium 2 / WebDriver server');
309-
}
310306
$this->started = true;
307+
308+
$this->applyTimeouts();
311309
}
312310

313311
/**

0 commit comments

Comments
 (0)