Overrides CoreDriver::executeScript
public function executeScript(string $script) { if (preg_match('/^function[\\s\\(]/', $script)) { $script = preg_replace('/;$/', '', $script); $script = '(' . $script . ')'; } $this->getWebDriverSession() ->execute(array( 'script' => $script, 'args' => array(), )); }