Skip to content

Commit

Permalink
POST /window must define handle first for Selenium 3.x and Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek authored and robocoder committed Oct 28, 2022
1 parent ed8f774 commit a39a1f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/WebDriver/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public function deleteCookie($cookieName)
/**
* window methods: /session/:sessionId/window (POST, DELETE)
* - $session->window() - close current window
* - $session->window($name) - set focus
* - $session->window($window_handle) - set focus
* - $session->window($window_handle)->method() - chaining
*
* @return \WebDriver\Window|\WebDriver\Session
Expand All @@ -233,7 +233,7 @@ public function window()
}

// set focus
$arg = func_get_arg(0); // window handle or name attribute
$arg = func_get_arg(0); // window handle

if (is_array($arg)) {
$this->curl('POST', '/window', $arg);
Expand All @@ -260,13 +260,13 @@ public function deleteWindow()
/**
* Set focus to window: /session/:sessionId/window (POST)
*
* @param mixed $name window handler or name attribute
* @param mixed $name window handle
*
* @return \WebDriver\Session
*/
public function focusWindow($name)
{
$this->curl('POST', '/window', array('name' => $name));
$this->curl('POST', '/window', array('handle' => $name, 'name' => $name));

return $this;
}
Expand Down

0 comments on commit a39a1f6

Please sign in to comment.