public function createBrowser($capabilities)
    {
        if (is_string($capabilities)) {
            $capabilities = new Capabilities($capabilities);
        } elseif (!$capabilities instanceof Capabilities) {
            throw new LibraryException(sprintf('Expected a Capabilities or a string, given a "%s"', gettype($capabilities)));
        }

        $response = $this->request('POST', '/session', json_encode(array('desiredCapabilities' => $capabilities->toArray())));
        $sessionId = $this->getSessionIdFromResponse($response);

        return $this->browsers[$sessionId] = new Browser($this, $sessionId);
    }