Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

BrowserStack Automate does not document a public image URL for a screenshot captured in a Nightwatch session. You can view automatically captured screenshots in Automate’s dashboard, or explicitly take a screenshot in your Nightwatch test and save it as a file. If you need a hosted image URL from BrowserStack, its separate Screenshots API creates screenshots from a submitted page URL and returns image URL fields; that is not a way to retrieve an Automate session screenshot.

First decide what you mean by “screenshot URL”

These workflows produce different results. A tested page URL, such as the value returned by Nightwatch’s browser.url(), is the address of the web page—not an image. A screenshot captured during an Automate session may be visible in the dashboard or saved as an image file, but the BrowserStack documentation cited here does not describe a public image URL for that session screenshot.

What you need Use What you get
Review screenshots created during test steps Automate visual logs, enabled with debug Dashboard screenshots, not a documented public image URL
Capture a specific moment in your Nightwatch test Nightwatch screenshot or saveScreenshot API Screenshot data or a file saved by the test
Get a hosted image URL for a page screenshot BrowserStack Screenshots API A separate screenshot job whose result can include image_url and thumb_url

View automatic screenshots in BrowserStack Automate

Automate visual logs capture screenshots during test execution and show them in the Automate dashboard. BrowserStack says visual logs are disabled by default. To enable them, set debug: true in the BrowserStack options for the session. This enables dashboard inspection; it is not a documented method for obtaining a public screenshot URL.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set the capability in Nightwatch configuration

For a non-SDK configuration, BrowserStack’s example places debug inside bstack:options. Use the same options object where you configure your BrowserStack session; retain your existing browser and platform capabilities.

capabilities: [{
  browserName: "chrome",
  "bstack:options": {
    debug: true
  }
}]

The snippet illustrates the location of the setting, not a complete cross-platform configuration. For the SDK-based setup, BrowserStack’s guide shows enabling debug: true in browserstack.yml. Follow the configuration format for the integration you actually use.

Once the test has run, open the corresponding session in the Automate dashboard and inspect its visual logs. If your aim is to attach an image to a bug report, download or otherwise retain a screenshot file through an explicit test capture instead of assuming the dashboard view has a shareable image URL.

Capture a screenshot at a specific point in a Nightwatch test

Use Nightwatch’s screenshot API when the timing matters—for example, after a particular assertion or after the application reaches the state you want to document. Nightwatch documents a screenshot API for capturing the current page and a saveScreenshot API for saving a screenshot to a path. BrowserStack also documents explicitly taking a screenshot from the test script and downloading it to the machine running the test.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Save a file from the test

Choose a destination path that exists in the test runner’s environment, and call the save API at the point you want captured:

Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option
module.exports = {
  'capture a page state': async function (browser) {
    await browser.url('https://example.com');

    // Run the interaction or assertion that reaches the state you need.
    await browser.saveScreenshot('./artifacts/example-page.png');

    await browser.end();
  }
};

This is a Nightwatch test example using the documented saveScreenshot API. Adapt the URL and path to your project, and check the API documentation for the syntax supported by the Nightwatch version installed in your project. The screenshot is saved on the machine running the test. If that machine is a short-lived CI runner, configure the CI system to retain or upload the artifact before the job ends; a local file on an ephemeral runner does not become a permanent hosted URL by itself.

Use the screenshot API when you do not want to save a file

Nightwatch also documents a screenshot API for capturing the current page. Its documentation describes an option for screenshot data to appear in verbose logs. That can help when you need screenshot data in the test’s logging output, but log visibility is not the same as a stable, public image URL. Consult the API page for the calling syntax and options for your installed Nightwatch version.

BrowserStack says explicitly captured screenshots may also be shown in a session’s text logs. That can make a capture easier to inspect alongside test output, but it still does not establish a public URL you can embed elsewhere.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Get image URLs from BrowserStack’s separate Screenshots API

If the actual requirement is a hosted image URL, BrowserStack’s Screenshots API is a distinct workflow: submit a page URL as a screenshot job, then retrieve the job results. The documented sequence is a POST to /screenshots, followed by a GET to /screenshots/<JOB-ID>.json. The results can include image_url and thumb_url, along with job state and browser/OS details.

  1. Create a screenshot job. Submit the page URL and the configuration required by the API. The BrowserStack examples use HTTP Basic authentication with a BrowserStack username and access key.
  2. Keep the returned job ID. You need it to request the job’s result.
  3. Retrieve the result. Send the documented GET request for that job ID and read the image URL fields from the returned result.
  4. Check the job state before relying on the image. The result includes state information; handle a job that is not yet complete according to the API’s current documentation.

This creates screenshots from a submitted web-page URL; it does not look up or expose the screenshot from a running Nightwatch Automate session. BrowserStack’s API documentation includes legacy browser examples, and eligibility is described as limited to Automate plans that include browsers. Check current plan eligibility, supported configurations, endpoint details, and result behavior in the BrowserStack Screenshots API documentation before building a dependency on a particular configuration.

Set up Nightwatch with BrowserStack safely

BrowserStack’s Nightwatch integration guide lists a BrowserStack username and access key, Node.js v12 or higher, and Nightwatch 2.6.0 or higher as prerequisites for the setup documented on that page. These are the versions printed in that guide, not a statement of the current latest releases or universal compatibility. The guide describes installing @nightwatch/browserstack, adding the plugin to Nightwatch configuration, and supplying credentials through environment variables.

  • Keep credentials in environment variables or your CI secret store; do not commit access keys into a public repository or print them in logs.
  • Configure the BrowserStack integration and session capabilities before running tests, then put the capture call at the point in the test where the relevant state is present.
  • Use a path writable by the test process. If a capture fails, check both the path and the runner’s filesystem permissions.
  • For CI, upload the saved image as a build artifact if it needs to outlive the runner. The screenshot API’s hosted URL workflow is separate from artifact retention.

For the documented integration details, see BrowserStack’s Nightwatch integration guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshoot missing screenshots and URLs

No visual logs appear in the dashboard

Check that visual logs are enabled: BrowserStack documents them as disabled by default. Confirm that debug: true is set in the correct place for your configuration—under bstack:options for the non-SDK example or in browserstack.yml for the SDK example—and inspect the right Automate session.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

The screenshot file is missing after CI finishes

First confirm the test reached the save call and that its destination directory exists and is writable. Then check the path relative to the runner’s working directory. If the test runs on temporary infrastructure, configure artifact upload or retention; saving a file during a job does not preserve it after the runner is removed.

You have a page URL but need an image

browser.url() identifies the current page. It does not capture the page. Call Nightwatch’s screenshot or saveScreenshot API for a test-time capture, or submit a page URL to the separate BrowserStack Screenshots API if you need its screenshot-job result fields.

The Automate dashboard screenshot has no shareable URL

The cited BrowserStack Automate and Nightwatch documentation describes dashboard viewing, explicit capture, and text-log visibility, but does not document a public image URL for an Automate session screenshot. Do not construct or guess an image URL pattern. Use a saved file and your own artifact or hosting workflow, or use the distinct Screenshots API when its page-URL job model fits.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The Screenshots API example does not match your account or browser

The API documentation includes legacy examples and says availability is limited to Automate plans that include browsers. Verify plan eligibility and current supported configurations in BrowserStack’s API documentation rather than assuming an old example is still accepted.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup:

ScreenshotNeo is a website screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF; its response includes page-verdict and billing headers. For example, this cURL call captures a page as WebP:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for setup and request options. Before capture, it accepts the cookie or consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed. The service also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots.

Sign up for 1,000 free screenshots a month with no card.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Official references

Frequently Asked Questions

Can I get a public URL for a screenshot in BrowserStack Automate?

The cited Automate documentation does not describe a public image URL for a session screenshot. It documents dashboard visual logs, explicit test captures, and session text-log visibility.

Does BrowserStack’s Screenshots API take a screenshot from a Nightwatch session?

No. It is a separate API that creates screenshot jobs from submitted page URLs; its results can include image URL fields.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.