session.status command

The session.status command of the session module returns information about whether the browser is able to create new BiDi sessions and may additionally include arbitrary meta information.

Since this command is used to check the status of the browser before creating a new session, it runs without an already active session. (In BiDi, such a command is called a static command.)

Syntax

json
{
  "method": "session.status",
  "params": {}
}

Parameters

None. However, you must include the params field and set it to an empty object ({}).

Return value

The result object in the response with the following fields:

ready

A boolean that indicates whether the browser is ready to create new sessions.

true

The browser is ready to create a new session.

false

The browser cannot accept new sessions because it already has an active session or is otherwise in a state where creating a session would fail.

message

A string with information about the browser's current status.

Examples

Checking browser status before creating a session

With a WebDriver BiDi connection established, send the following message to check whether the browser is ready to create a new session:

json
{
  "id": 1,
  "method": "session.status",
  "params": {}
}

When the browser is available, it responds with:

json
{
  "id": 1,
  "type": "success",
  "result": {
    "ready": true,
    "message": ""
  }
}

If the browser already has an active session, the response might look as follows:

json
{
  "id": 1,
  "type": "success",
  "result": {
    "ready": false,
    "message": "Session already started"
  }
}

Specifications

Specification
WebDriver BiDi
# command-session-status

Browser compatibility

See also