Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
browser automation

How to Take Safari Screenshots with Selenium Grid and RemoteWebDriver

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

Use Selenium’s RemoteWebDriver to start Safari on a Grid node, navigate to the page, wait for the state you need, and call the screenshot API. In Python, get_screenshot_as_png() returns PNG bytes to the test client, where you can store them with your test artifacts. The built-in command captures the current browser window—not automatically the entire scrollable page.

How the remote screenshot flow works

Your test runner and Safari are separate processes, and often separate machines:

  1. The client sends a session request to the Selenium Grid URL with Safari options.
  2. Grid routes the request to a node that has macOS, Safari, and safaridriver.
  3. The node opens the browser and executes WebDriver commands.
  4. The screenshot command returns PNG data through Grid to the client.
  5. The client writes the returned data to its own filesystem.

That last distinction matters. A path such as artifacts/safari.png belongs to the process writing it. It is not automatically a path on the remote Safari node.

Prerequisites on the Safari Grid node

Install the Grid components

Selenium’s current Grid getting-started guidance lists Java 11 or newer, an installed browser and driver, and the Selenium Server JAR as the basic requirements. A standalone server can be started with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Apple 2026 MacBook Air 13-inch Laptop with M5 chip: Built for AI, 13.6-inch Liquid Retina Display, 16GB Unified Memory, 512GB SSD, 12MP Center Stage Camera, Touch ID, Wi-Fi 7; Midnight
  • BUILT FOR COLLEGE. AND BEYOND — MacBook Air with the M5 chip packs blazing speed and powerful AI capabilities into an incredibly portable design. And with up to 18 hours of battery life,* this thin and light powerhouse is ready to take on almost any major, just about anywhere.
  • TEAR THROUGH TOUGH ASSIGNMENTS — With its faster CPU and unified memory, the M5 chip delivers even more performance and fluidity across apps, making multitasking and creative workflows smooth and responsive. A powerful Neural Engine and next-generation GPU with Neural Accelerators give you a powerful platform for AI.
  • MAKE QUICK WORK OF YOUR TO-DO LIST — Apple Intelligence helps you write, express yourself, and get things done effortlessly — whether it’s for school or everyday life. With groundbreaking privacy protections, it gives you peace of mind that no one else can access your data — not even Apple.*
  • UP TO 18 HOURS OF BATTERY LIFE — MacBook Air delivers incredible battery life with amazing performance, so you can power through a full day of classes without worrying about plugging in.
  • A BRILLIANT 13.6-INCH DISPLAY* — The gorgeous Liquid Retina display on MacBook Air supports 1 billion colors, making photos and videos pop with rich contrast and sharp detail, and text appears supercrisp. So everything — from class presentations to movies to games — looks truly stunning.
java -jar selenium-server-<version>.jar standalone

For a multi-machine deployment, run a Hub and register the Mac as a node. The browser and driver must exist on the node that will execute the Safari session; installing Safari only on the client does not make it available remotely. Selenium nodes discover drivers from the system PATH by default. Selenium Manager can configure drivers when enabled with --selenium-manager true, but verify the actual environment on the Safari host.

Enable Safari remote automation

Apple identifies Safari’s WebDriver executable as safaridriver. On the Mac that will run Safari, open Safari’s Develop menu and choose Develop > Allow Remote Automation, as documented by Apple’s Safari WebDriver documentation. Without this permission, Grid may be healthy while Safari sessions fail to launch.

Protect the Grid endpoint

Do not expose an unrestricted Grid to the public internet. Selenium warns that an exposed Grid can provide access to infrastructure and allow third parties to run custom binaries. Put the Hub and nodes behind firewall and network controls, require authentication where appropriate, and follow your CI environment’s security policy.

Python: complete RemoteWebDriver screenshot example

Install Selenium in the client environment first:

python -m pip install -U selenium

The following example connects to a Grid endpoint, opens a page, waits for the document to reach a usable state, retrieves PNG bytes, creates the artifact directory, and saves the image on the client:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Apple 2026 MacBook Air 13-inch Laptop with M5 chip: Built for AI, 13.6-inch Liquid Retina Display, 16GB Unified Memory, 512GB SSD, 12MP Center Stage Camera, Touch ID, Wi-Fi 7; Silver
  • BUILT FOR COLLEGE. AND BEYOND — MacBook Air with the M5 chip packs blazing speed and powerful AI capabilities into an incredibly portable design. And with up to 18 hours of battery life,* this thin and light powerhouse is ready to take on almost any major, just about anywhere.
  • TEAR THROUGH TOUGH ASSIGNMENTS — With its faster CPU and unified memory, the M5 chip delivers even more performance and fluidity across apps, making multitasking and creative workflows smooth and responsive. A powerful Neural Engine and next-generation GPU with Neural Accelerators give you a powerful platform for AI.
  • MAKE QUICK WORK OF YOUR TO-DO LIST — Apple Intelligence helps you write, express yourself, and get things done effortlessly — whether it’s for school or everyday life. With groundbreaking privacy protections, it gives you peace of mind that no one else can access your data — not even Apple.*
  • UP TO 18 HOURS OF BATTERY LIFE — MacBook Air delivers incredible battery life with amazing performance, so you can power through a full day of classes without worrying about plugging in.
  • A BRILLIANT 13.6-INCH DISPLAY* — The gorgeous Liquid Retina display on MacBook Air supports 1 billion colors, making photos and videos pop with rich contrast and sharp detail, and text appears supercrisp. So everything — from class presentations to movies to games — looks truly stunning.
from pathlib import Path

from selenium import webdriver
from selenium.webdriver.safari.options import Options
from selenium.webdriver.support.ui import WebDriverWait

GRID_URL = "http://grid-host:4444"
TARGET_URL = "https://example.com"
OUTPUT = Path("artifacts/safari.png")

options = Options()
driver = webdriver.Remote(
    command_executor=GRID_URL,
    options=options,
)

try:
    driver.get(TARGET_URL)
    WebDriverWait(driver, 30).until(
        lambda d: d.execute_script("return document.readyState") == "complete"
    )
    OUTPUT.parent.mkdir(parents=True, exist_ok=True)
    png_bytes = driver.get_screenshot_as_png()
    OUTPUT.write_bytes(png_bytes)
    print(f"Saved {len(png_bytes)} bytes to {OUTPUT}")
finally:
    driver.quit()

webdriver.Remote needs both the Grid address and browser options. Replace http://grid-host:4444 with the endpoint reachable from your test runner. Keep quit() in finally so a failed assertion or navigation does not leave a Safari session consuming the node.

Wait for the state you actually need

“Page loaded” is not always the same as “screenshot ready.” Add a wait for a target element, a loading indicator to disappear, or the application’s normal readiness condition. A fixed sleep can be useful for a known animation, but an explicit condition generally produces more reliable artifacts:

WebDriverWait(driver, 30).until(
    lambda d: d.find_element("css selector", "main.dashboard").is_displayed()
)

Take the screenshot only after cookies, asynchronous content, fonts, and layout changes relevant to your test have settled.

Choosing a screenshot API and destination

Method Result Best fit Important detail
get_screenshot_as_png() PNG bytes CI artifacts, image processing, custom storage You explicitly write the file on the client.
get_screenshot_as_file(filename) Boolean success result Simple file output The writing process interprets the path; check the returned boolean.
save_screenshot(filename) Boolean success result Alias-style file saving in Python bindings It is still a current-window PNG capture.

The Python API reference documents the byte-returning method and the file methods in Selenium’s Python WebDriver API. For a remote run, bytes are often easiest because the test runner controls where the artifact is stored:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Apple 2026 MacBook Air 13-inch Laptop with M5 chip: Built for AI, 13.6-inch Liquid Retina Display, 16GB Unified Memory, 512GB SSD, 12MP Center Stage Camera, Touch ID, Wi-Fi 7; Sky Blue
  • BUILT FOR COLLEGE. AND BEYOND — MacBook Air with the M5 chip packs blazing speed and powerful AI capabilities into an incredibly portable design. And with up to 18 hours of battery life,* this thin and light powerhouse is ready to take on almost any major, just about anywhere.
  • TEAR THROUGH TOUGH ASSIGNMENTS — With its faster CPU and unified memory, the M5 chip delivers even more performance and fluidity across apps, making multitasking and creative workflows smooth and responsive. A powerful Neural Engine and next-generation GPU with Neural Accelerators give you a powerful platform for AI.
  • MAKE QUICK WORK OF YOUR TO-DO LIST — Apple Intelligence helps you write, express yourself, and get things done effortlessly — whether it’s for school or everyday life. With groundbreaking privacy protections, it gives you peace of mind that no one else can access your data — not even Apple.*
  • UP TO 18 HOURS OF BATTERY LIFE — MacBook Air delivers incredible battery life with amazing performance, so you can power through a full day of classes without worrying about plugging in.
  • A BRILLIANT 13.6-INCH DISPLAY* — The gorgeous Liquid Retina display on MacBook Air supports 1 billion colors, making photos and videos pop with rich contrast and sharp detail, and text appears supercrisp. So everything — from class presentations to movies to games — looks truly stunning.
success = driver.get_screenshot_as_file("artifacts/safari.png")
if not success:
    raise RuntimeError("Selenium could not write the screenshot")

Java RemoteWebDriver shape

In Java, the same sequence is used: create Safari options, pass the Grid URL to RemoteWebDriver, navigate, capture, and quit in a finally block.

import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Path;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.safari.SafariOptions;

SafariOptions options = new SafariOptions();
WebDriver driver = new RemoteWebDriver(
    URI.create("http://grid-host:4444").toURL(), options);
try {
    driver.get("https://example.com");
    byte[] png = ((RemoteWebDriver) driver)
        .getScreenshotAs(OutputType.BYTES);
    Files.createDirectories(Path.of("artifacts"));
    Files.write(Path.of("artifacts/safari.png"), png);
} finally {
    driver.quit();
}

Use the Java screenshot return type that matches your artifact pipeline, such as OutputType.FILE or OutputType.BYTES. Selenium’s RemoteWebDriver guidance notes that browser-specific remote interfaces may require Augmenter; add it only when the particular interface you use requires it.

What this screenshot includes—and what it does not

The standard WebDriver screenshot command described here captures the current Safari window. It does not promise a full-page image of every scrollable pixel. If you need a full-page result, treat that as a separate capability question and verify support for your installed Safari version, Selenium binding, and remote setup before relying on a recipe. A viewport resize, element capture, or stitched-image workflow may be appropriate, but those are not implied by get_screenshot_as_png().

The capture reflects the window at the instant the command executes. Fixed headers, scroll position, open menus, animations, consent dialogs, and responsive breakpoints therefore matter. Set the window or viewport deliberately, dismiss or handle application UI as part of the test, and wait for the visual state you intend to document.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Apple 2026 MacBook Air 13-inch Laptop with M5 chip: Built for AI, 13.6-inch Liquid Retina Display, 16GB Unified Memory, 512GB SSD, 12MP Center Stage Camera, Touch ID, Wi-Fi 7; Starlight
  • BUILT FOR COLLEGE. AND BEYOND — MacBook Air with the M5 chip packs blazing speed and powerful AI capabilities into an incredibly portable design. And with up to 18 hours of battery life,* this thin and light powerhouse is ready to take on almost any major, just about anywhere.
  • TEAR THROUGH TOUGH ASSIGNMENTS — With its faster CPU and unified memory, the M5 chip delivers even more performance and fluidity across apps, making multitasking and creative workflows smooth and responsive. A powerful Neural Engine and next-generation GPU with Neural Accelerators give you a powerful platform for AI.
  • MAKE QUICK WORK OF YOUR TO-DO LIST — Apple Intelligence helps you write, express yourself, and get things done effortlessly — whether it’s for school or everyday life. With groundbreaking privacy protections, it gives you peace of mind that no one else can access your data — not even Apple.*
  • UP TO 18 HOURS OF BATTERY LIFE — MacBook Air delivers incredible battery life with amazing performance, so you can power through a full day of classes without worrying about plugging in.
  • A BRILLIANT 13.6-INCH DISPLAY* — The gorgeous Liquid Retina display on MacBook Air supports 1 billion colors, making photos and videos pop with rich contrast and sharp detail, and text appears supercrisp. So everything — from class presentations to movies to games — looks truly stunning.

Safari Grid capacity and parallel execution

Selenium’s current Grid guide states that a node’s default concurrent-session limit generally follows available CPUs, with the exception of Safari, which is always one. Plan on one concurrent Safari session per node, and add additional Safari-capable nodes for parallel tests. This is version-sensitive operational guidance; confirm behavior against the Selenium version installed in your environment.

Parallel workers also need independent artifact names. Include a test identifier, browser, and timestamp or worker index in each output path so concurrent jobs do not overwrite one another.

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

Troubleshooting common failures

Session cannot be created

  • Cause: Safari remote automation is disabled. Fix: On the Safari Mac, choose Develop > Allow Remote Automation.
  • Cause: safaridriver is missing or not discoverable. Fix: Check the node’s PATH and confirm the driver is available on that Mac, not only on the client.
  • Cause: The client is using the wrong Grid URL or port. Fix: Verify the endpoint from the client machine and inspect Grid’s node registration.
  • Cause: The requested capabilities do not match the registered node. Fix: Use SafariOptions and remove unsupported or copied capabilities.

Navigation times out or the page is blank

  • Check DNS, firewall rules, proxy settings, and outbound access from the Safari node.
  • Wait for a meaningful application condition rather than immediately capturing after get().
  • Capture diagnostic page metadata or a screenshot before retrying so you can distinguish a site failure from a Grid failure.

The file is missing on the expected machine

If you used a file method, the path belongs to the process that writes it. With the byte-returning method, write the bytes on the client explicitly and ensure the parent directory exists. If using a file method, test its Boolean return value instead of assuming success.

The image is cropped or missing lower content

That is consistent with a current-window capture. Do not label it full-page without verifying a supported full-page method for your exact Safari and Selenium combination.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Apple 2026 MacBook Air 15-inch Laptop with M5 chip: Built for AI, 15.3-inch Liquid Retina Display, 16GB Unified Memory, 512GB SSD, 12MP Center Stage Camera, Touch ID, Wi-Fi 7; Midnight
  • BUILT FOR COLLEGE. AND BEYOND — MacBook Air with the M5 chip packs blazing speed and powerful AI capabilities into an incredibly portable design. And with up to 18 hours of battery life,* this thin and light powerhouse is ready to take on almost any major, just about anywhere.
  • TEAR THROUGH TOUGH ASSIGNMENTS — With its faster CPU and unified memory, the M5 chip delivers even more performance and fluidity across apps, making multitasking and creative workflows smooth and responsive. A powerful Neural Engine and next-generation GPU with Neural Accelerators give you a powerful platform for AI.
  • MAKE QUICK WORK OF YOUR TO-DO LIST — Apple Intelligence helps you write, express yourself, and get things done effortlessly — whether it’s for school or everyday life. With groundbreaking privacy protections, it gives you peace of mind that no one else can access your data — not even Apple.*
  • UP TO 18 HOURS OF BATTERY LIFE — MacBook Air delivers incredible battery life with amazing performance, so you can power through a full day of classes without worrying about plugging in.
  • A BRILLIANT 15.3-INCH DISPLAY* — The gorgeous Liquid Retina display on MacBook Air supports 1 billion colors, making photos and videos pop with rich contrast and sharp detail, and text appears supercrisp. So everything — from class presentations to movies to games — looks truly stunning.

Sessions queue instead of running in parallel

Safari’s documented one-session-per-node limit is the likely constraint. Register more Safari nodes and ensure each node has its own usable Safari environment.

Or skip the browser setup

If your requirement is simply a reliable website image rather than Safari/WebDriver test control, ScreenshotNeo provides a one-request screenshot API. It accepts consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. It also offers an MCP server for AI clients such as Claude and Cursor, with take_screenshot, get_page_info, and capture_pdf tools.

See the complete parameter reference in the ScreenshotNeo documentation. A cURL request is:

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

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

It supports full-page capture with lazy images loaded, CSS-selector element capture, dark mode, device presets and custom viewports, retina scale, PDF settings, custom CSS and JavaScript, clicks, waits, request blocking, headers, cookies, user agents, authorization, timezone and geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed image links, asynchronous webhooks, bulk capture of up to 100 URLs per call, usage reporting, and an OpenAPI specification. Its parameter names are compatible with those used by other screenshot APIs, which can simplify migration.

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.

Every plan includes every feature: 1,000 screenshots per month free with no card, then Starter at $5 for 3,000, Growth at $15 for 15,000, Pro at $39 for 60,000, Scale at $99 for 250,000, and Business at $249 for 1,000,000. Yearly billing provides two months free. Create a free ScreenshotNeo account to get the 1,000 monthly screenshots without a card.

Operational checklist

  • Confirm the Grid endpoint is reachable from the test client.
  • Confirm the Safari node is a Mac with Safari and safaridriver.
  • Enable Develop > Allow Remote Automation on that Mac.
  • Use RemoteWebDriver with Safari options.
  • Wait for the application state you intend to capture.
  • Use PNG bytes when the client should own artifact storage.
  • Check Boolean results when using file-saving methods.
  • Keep Grid private and plan one concurrent Safari session per node.
  • Describe the result as a current-window screenshot unless full-page support has been verified separately.

Frequently Asked Questions

Can I run Safari WebDriver from a Windows or Linux client?

Yes. The client can send RemoteWebDriver commands from another operating system, but the Grid node executing the session must provide the Safari environment, including Safari and safaridriver on macOS.

Where should screenshots be uploaded in CI?

Retrieve PNG bytes on the client and write them into the CI system’s artifact directory or upload stream. This avoids confusing the node filesystem with the runner filesystem.

Does ScreenshotNeo reproduce a Safari browser exactly?

No. ScreenshotNeo is a separate website screenshot service. Use Safari Grid when Safari-specific browser behavior is the subject; use ScreenshotNeo when you need an API capture without maintaining a browser node.

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

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Read next

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.