selenium.webdriver.remote.remote_connection

class selenium.webdriver.remote.remote_connection.HttpErrorHandler[source]

A custom HTTP error handler.

Used to return Response objects instead of raising an HTTPError exception.

http_error_default(req, fp, code, msg, headers)[source]

Default HTTP error handler.

Args :
  • req - The original Request object.
  • fp - The response body file object.
  • code - The HTTP status code returned by the server.
  • msg - The HTTP status message returned by the server.
  • headers - The response headers.
Returns :

A new Response object.

class selenium.webdriver.remote.remote_connection.RemoteConnection(remote_server_addr, keep_alive=False)[source]

A connection with the Remote WebDriver server.

Communicates with the server using the WebDriver wire protocol: http://code.google.com/p/selenium/wiki/JsonWireProtocol

execute(command, params)[source]

Send a command to the remote server.

Any path subtitutions required for the URL mapped to the command should be included in the command parameters.

Args :
  • command - A string specifying the command to execute.
  • params - A dictionary of named parameters to send with the command as its JSON payload.
class selenium.webdriver.remote.remote_connection.Request(url, data=None, method=None)[source]

Extends the url_request.Request to support all HTTP request types.

Initialise a new HTTP request.

Args :
  • url - String for the URL to send the request to.
  • data - Data to send with the request.
get_method()[source]

Returns the HTTP method used by this request.

class selenium.webdriver.remote.remote_connection.Response(fp, code, headers, url)[source]

Represents an HTTP response.

Initialise a new Response.

Args :
  • fp - The response body file object.
  • code - The HTTP status code returned by the server.
  • headers - A dictionary of headers returned by the server.
  • url - URL of the retrieved resource represented by this Response.
close()[source]

Close the response body file object.

geturl()[source]

Returns the URL for the resource returned in this response.

info()[source]

Returns the response headers.

This Page