leadfoot/Server

Inheritance

  1. leadfoot/Server
  2. Object

new (require("leadfoot/Server"))(url: Object|string, optionsopt: Object)

The Server class represents a remote HTTP server implementing the WebDriver wire protocol that can be used to generate new remote control sessions.

Parameters

Name Type Attributes Description
url Object|string

The fully qualified URL to the JsonWireProtocol endpoint on the server. The default endpoint for a JsonWireProtocol HTTP server is http://localhost:4444/wd/hub. You may also pass a parsed URL object which will be converted to a string.

options Object optional

Additional request options to be used for requests to the server.

All Properties

Property Defined by

Whether or not to perform capabilities testing and correction when creating a new Server.

leadfoot/Server

An alternative session constructor.

leadfoot/Server

All Methods

Method Defined by
createSession(desiredCapabilities: Capabilities, requiredCapabilitiesopt: Capabilities): Promise.<leadfoot/Session>

Creates a new remote control session on the remote server.

leadfoot/Server
deleteSession(sessionId: string): Promise.<void>

Terminates a session on the server.

leadfoot/Server
getSessionCapabilities(sessionId: string): Promise.<Object>

Gets information on the capabilities of a given session from the server.

leadfoot/Server
getSessions(): Promise.<Array.<Object>>

Gets a list of all currently active remote control sessions on this server.

leadfoot/Server
getStatus(): Promise.<Object>

Gets the status of the remote server.

leadfoot/Server
createHttpRequest(method: string): function
(inner)

Creates a function that performs an HTTP request to a JsonWireProtocol endpoint.

leadfoot/Server
returnValue(response: Object): any
(inner)

Returns the actual response value from the remote environment.

leadfoot/Server

Properties

fixSessionCapabilities: boolean

Whether or not to perform capabilities testing and correction when creating a new Server.

Defaults to

true

sessionConstructor: leadfoot/Session

An alternative session constructor. Defaults to the standard leadfoot/Session constructor if one is not provided.

Defaults to

Session

Methods

createSession(desiredCapabilities: Capabilities, requiredCapabilitiesopt: Capabilities): Promise.<leadfoot/Session>

Creates a new remote control session on the remote server.

Parameters

Name Type Attributes Description
desiredCapabilities Capabilities

A hash map of desired capabilities of the remote environment. The server may return an environment that does not match all the desired capabilities if one is not available.

requiredCapabilities Capabilities optional

A hash map of required capabilities of the remote environment. The server will not return an environment that does not match all the required capabilities if one is not available.

deleteSession(sessionId: string): Promise.<void>

Terminates a session on the server.

Parameters

Name Type
sessionId string

getSessionCapabilities(sessionId: string): Promise.<Object>

Gets information on the capabilities of a given session from the server. The list of capabilities returned by this command will not include any of the extra session capabilities detected by Leadfoot and may be inaccurate.

Parameters

Name Type
sessionId string

getSessions(): Promise.<Array.<Object>>

Gets a list of all currently active remote control sessions on this server.

getStatus(): Promise.<Object>

Gets the status of the remote server.

Returns

  • An object containing arbitrary properties describing the status of the remote server.

(inner) createHttpRequest(method: string): function

Creates a function that performs an HTTP request to a JsonWireProtocol endpoint.

Parameters

Name Type Description
method string

The HTTP method to fix.

Source

(inner) returnValue(response: Object): any

Returns the actual response value from the remote environment.

Parameters

Name Type Description
response Object

JsonWireProtocol response object.

Returns

  • The actual response value.