Skip to content

Commit a39a1f6

Browse files
mvorisekrobocoder
authored andcommitted
POST /window must define handle first for Selenium 3.x and Firefox
1 parent ed8f774 commit a39a1f6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/WebDriver/Session.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public function deleteCookie($cookieName)
218218
/**
219219
* window methods: /session/:sessionId/window (POST, DELETE)
220220
* - $session->window() - close current window
221-
* - $session->window($name) - set focus
221+
* - $session->window($window_handle) - set focus
222222
* - $session->window($window_handle)->method() - chaining
223223
*
224224
* @return \WebDriver\Window|\WebDriver\Session
@@ -233,7 +233,7 @@ public function window()
233233
}
234234

235235
// set focus
236-
$arg = func_get_arg(0); // window handle or name attribute
236+
$arg = func_get_arg(0); // window handle
237237

238238
if (is_array($arg)) {
239239
$this->curl('POST', '/window', $arg);
@@ -260,13 +260,13 @@ public function deleteWindow()
260260
/**
261261
* Set focus to window: /session/:sessionId/window (POST)
262262
*
263-
* @param mixed $name window handler or name attribute
263+
* @param mixed $name window handle
264264
*
265265
* @return \WebDriver\Session
266266
*/
267267
public function focusWindow($name)
268268
{
269-
$this->curl('POST', '/window', array('name' => $name));
269+
$this->curl('POST', '/window', array('handle' => $name, 'name' => $name));
270270

271271
return $this;
272272
}

0 commit comments

Comments
 (0)