startSession($desired_capabilities); return $driver; } public function startSession(DesiredCapabilities $desired_capabilities) { $command = new WebDriverCommand( null, DriverCommand::NEW_SESSION, [ 'desiredCapabilities' => $desired_capabilities->toArray(), ] ); $response = $this->executor->execute($command); $this->sessionID = $response->getSessionID(); } /** * Always throws an exception. Use ChromeDriver::start() instead. * * @throws WebDriverException */ public static function create( $selenium_server_url = 'http://localhost:4444/wd/hub', $desired_capabilities = null, $connection_timeout_in_ms = null, $request_timeout_in_ms = null, $http_proxy = null, $http_proxy_port = null, DesiredCapabilities $required_capabilities = null ) { throw new WebDriverException('Please use ChromeDriver::start() instead.'); } /** * Always throws an exception. Use ChromeDriver::start() instead. * * @param string $session_id The existing session id * @param string $selenium_server_url The url of the remote Selenium WebDriver server * * @throws WebDriverException * @return RemoteWebDriver|void */ public static function createBySessionID( $session_id, $selenium_server_url = 'http://localhost:4444/wd/hub' ) { throw new WebDriverException('Please use ChromeDriver::start() instead.'); } }