Skip to content

Commit

Permalink
Close all, but main window during session reset
Browse files Browse the repository at this point in the history
  • Loading branch information
aik099 committed Mar 11, 2024
1 parent 63f9424 commit ec98133
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Selenium2Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,19 @@ public function stop()

public function reset()
{
$this->getWebDriverSession()->deleteAllCookies();
$webDriverSession = $this->getWebDriverSession();

foreach ($this->getWindowNames() as $name) {
if ($name === $this->initialWindowName) {
continue;
}

$this->switchToWindow($name);
$webDriverSession->deleteWindow();
$this->switchToWindow();
}

$webDriverSession->deleteAllCookies();
}

public function visit(string $url)
Expand Down

0 comments on commit ec98133

Please sign in to comment.