Skip to content

Commit

Permalink
Fix Session::{execute, execute_async}, must use value result
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek authored and robocoder committed Apr 15, 2022
1 parent 8bb204d commit 623eb02
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions lib/WebDriver/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ protected function methods()
'forward' => array('POST'),
'back' => array('POST'),
'refresh' => array('POST'),
'execute' => array('POST'),
'execute_async' => array('POST'),
'screenshot' => array('GET'),
'cookie' => array('GET', 'POST'), // for DELETE, use deleteAllCookies()
'source' => array('GET'),
Expand Down Expand Up @@ -433,13 +431,11 @@ public function log()
*/
public function execute(array $jsonScript)
{
if (isset($jsonScript['args'])) {
$jsonScript['args'] = $this->serializeArguments($jsonScript['args']);
}
$jsonScript['args'] = $this->serializeArguments($jsonScript['args']);

$result = $this->curl('POST', '/execute', $jsonScript);

return $this->unserializeResult($result);
return $this->unserializeResult($result['value']);
}

/**
Expand All @@ -451,13 +447,11 @@ public function execute(array $jsonScript)
*/
public function execute_async(array $jsonScript)
{
if (isset($jsonScript['args'])) {
$jsonScript['args'] = $this->serializeArguments($jsonScript['args']);
}
$jsonScript['args'] = $this->serializeArguments($jsonScript['args']);

$result = $this->curl('POST', '/execute_async', $jsonScript);

return $this->unserializeResult($result);
return $this->unserializeResult($result['value']);
}

/**
Expand Down

0 comments on commit 623eb02

Please sign in to comment.