Skip to content
On this page

Overview

💡 Disclaimer

This API is still in development and is not yet available for public sign-up. If you are interested in using this API, please reach out to us at hello@launchbrightly.com for further info.

Debugging

There might be situation where your screenshots are failing and the error messages returned by the API are not enough.

The screenshot API allows you to visually debug at different steps by capturing snapshots of the page.

Enabling Debugging

Set the stepImages attribute to either onError or all to enable capturing snapshots.

ValueDescription
onErrorCapture snapshots only when screenshot capture fails.
allCapture snapshots regardless if screenshot capture is successful or fails.

When the stepImages is not explicitly specified, no snapshots are captured.

Example: Capturing snapshots

Request:

POST /screenshot

json
{
  "stepImages": "all",
  "elementSelector": [
    "body"
  ],
  "steps": [
    {
      "type": "navigate",
      "url": "https://example.org"
    },
    {
      "selectors": [
        "#fake"
      ],
      "timeout": 10000,
      "type": "waitForElement"
    }
  ]
}

Response:

json
{
    "id": "b195008b-b313-4855-8607-3832baa42b64",
    "status": "failed",
    "message": "The following selector(s) associated with step 'waitForElement' were either not found or timed out: #fake",
    "createdAt": "2024-04-16T14:40:30.194Z",
    "updatedAt": "2024-04-16T14:44:43.232Z",
    "filesize": {
        "raw": null,
        "styled": null
    },
    "url": {
        "raw": null,
        "styled": null
    },
    "snapshots": [
        {
            "step": {
                "type": "navigate",
                "description": "navigate",
                "url": "https://example.org/"
            },
            "data": "https://launchbrightlyf9ff5e67329842e1a3a8fc00d5a7569c145137-prod.s3.us-east-1.amazonaws.com/debug/2024-04-16/b74c93c172803c11cf60f8d4492569e1db06af5497e231d5d7a44ed0447ea788_navigate.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIASH5PNXSCN5O7E7U2%2F20240416%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240416T144744Z&X-Amz-Expires=3600&X-Amz-Signature=738d071c11f4616caf8407306487c99bc6a6d342267a8ad7bf01f580e285f26c&X-Amz-SignedHeaders=host&x-id=GetObject"
        }
    ]
}