capabilities.work

Function Then Screenshot

A 2-step recipe with Browserless. We can help you get access.

Recipe · 2 steps

Function Then Screenshot

Execute custom JavaScript on a page, then screenshot the resulting state.

  1. Execute the supplied JavaScript against a Browserless session. The response shape is determined by the function's returned value.
  2. Capture a full-page PNG screenshot of the URL to confirm the page state after the function executed.
What you'll need to have ready
  • token: The Browserless authorization token passed as a query parameter.
  • code: The JavaScript function body to execute against the Browserless session.
  • url: The URL to screenshot after the function runs.
  • context: Optional context values passed into the executed function.
For your developer

Arazzo workflow browserless:function-then-screenshot, 2 operations: {$sourceDescriptions.browserRestApisApi.url}#/paths/~1chrome~1function/post → {$sourceDescriptions.browserRestApisApi.url}#/paths/~1chrome~1screenshot/post. Specs on APIs.io.