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

Each Selenium screenshot belongs to one WebDriver session on one Grid Node. A Grid Router uses the session ID to forward the command to the Node that owns that browser. It does not merge images from different Nodes or Grid deployments. For parallel captures, keep a separate driver (and session ID) per browser, capture on that driver after the required page state is ready, and store the image with your test identity.

What “multiple Grid instances” means

The phrase can describe two different arrangements:

  • Multiple Nodes in one Grid: one Grid entry point schedules sessions onto several machines or processes. Each session occupies a slot on one Node.
  • Separate Grid deployments: independent Standalone, Hub-Node, or distributed Grids, each with its own endpoint and capacity. A RemoteWebDriver connects to one endpoint; that endpoint determines where the session is created.

In either arrangement, screenshot ownership is per session. A screenshot call never polls every Node. It asks the browser represented by the particular RemoteWebDriver object for its current pixels.

Which Grid instance takes my screenshot?

Routing inside one Grid

When a session is created, the Distributor assigns it to an available slot. The Session Map records the session ID and the address of the Node running it. For an existing session, the Router reads that mapping and forwards the WebDriver command to that Node. Therefore, driver.get_screenshot_as_file() (Python) or the equivalent binding method reaches the browser already associated with driver.

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

Two sessions created by the same test process can be placed on different Nodes, or on different slots of one Node. Their screenshots remain independent because each command includes a different session ID.

Separate Grid deployments

If you have, for example, a Linux Grid and a Windows Grid, create a RemoteWebDriver against the endpoint for the deployment you intend to use. The screenshot is taken there. There is no documented cross-Grid screenshot aggregation feature, so your test harness must label and collect artifacts from each endpoint itself.

Capture screenshots from parallel RemoteWebDriver sessions

Design rules

  • Create and retain one driver object per browser session; do not overwrite a shared driver variable in concurrent workers.
  • Navigate and wait for the required state on that same worker before capturing.
  • Serialize commands sent to an individual driver unless your Selenium binding and test framework explicitly document safe concurrent use. The Grid architecture describes most WebDriver calls as synchronous but does not provide a universal same-session thread-order guarantee.
  • Attach a stable test or case ID to every image. Selenium Grid supports metadata such as se:name, which can be viewed in the Grid UI or through GraphQL.

Python example: one session per worker

from concurrent.futures import ThreadPoolExecutor, as_completed
from pathlib import Path
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

GRID_URL = "http://grid-host:4444"
OUT = Path("screenshots")
OUT.mkdir(exist_ok=True)

def capture(case):
    case_id, target_url = case
    options = Options()
    options.add_argument("--headless=new")
    # Grid metadata; supported Selenium versions expose this as a capability.
    options.set_capability("se:name", f"screenshot-{case_id}")
    driver = webdriver.Remote(command_executor=GRID_URL, options=options)
    try:
        driver.get(target_url)
        WebDriverWait(driver, 30).until(
            EC.presence_of_element_located((By.TAG_NAME, "body"))
        )
        path = OUT / f"{case_id}-{driver.session_id}.png"
        driver.save_screenshot(str(path))
        return {"case": case_id, "session": driver.session_id, "file": str(path)}
    finally:
        driver.quit()

cases = [
    ("home", "https://example.com/"),
    ("docs", "https://www.selenium.dev/documentation/"),
]
with ThreadPoolExecutor(max_workers=len(cases)) as pool:
    futures = [pool.submit(capture, case) for case in cases]
    for future in as_completed(futures):
        print(future.result())

Every worker owns its RemoteWebDriver, waits for its own page, and names the output with both the case and session ID. Replace the Grid URL with the endpoint for the deployment you want. The same pattern works with Firefox, Edge, or another requested capability.

Java example: explicit driver ownership

ChromeOptions options = new ChromeOptions();
options.addArguments("--headless=new");
options.setCapability("se:name", "checkout-desktop");

WebDriver driver = new RemoteWebDriver(
    URI.create("http://grid-host:4444").toURL(), options);
try {
    driver.get("https://example.com/checkout");
    new WebDriverWait(driver, Duration.ofSeconds(30))
        .until(ExpectedConditions.presenceOfElementLocated(By.tagName("body")));
    File source = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
    Files.copy(source.toPath(), Path.of("checkout-" +
        ((RemoteWebDriver) driver).getSessionId() + ".png"));
} finally {
    driver.quit();
}

In a parallel executor, instantiate this block inside each task. Never let two tasks issue navigation and screenshot commands through the same driver reference.

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

What exactly gets captured?

The screenshot reflects the current state of that browser session: URL, viewport, scroll position, loaded resources, cookies, and any overlays present at the instant the command runs. Grid does not make a page “ready” for you. Add an explicit wait for a meaningful condition (an element, a JavaScript state, or an application-specific marker) rather than relying only on a fixed sleep.

A normal screenshot command captures the viewport supported by your browser driver. Full-page behavior, image format, and stitching details depend on the Selenium binding and browser driver you use; do not assume that a command issued through Grid automatically produces a full document image. If you need a full-page artifact, verify the capability and behavior for your exact browser and Selenium versions.

Finding the Node that owns a session

Check Grid status

The Grid status endpoint reports registered Nodes, availability, active sessions, and slots. Use it when sessions are queued or when you suspect a Node is unhealthy. The default entry point for the documented Standalone, Hub-Node, and fully distributed modes is port 4444, unless you configured another port.

Use the session-owner check

Grid’s endpoints include a Node session-owner request that checks whether a supplied session ID belongs to that Node. Query the endpoint on the Node you are investigating, using the session ID returned by your RemoteWebDriver. This distinguishes “the session is on another Node” from “the session no longer exists.”

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

Correlate artifacts

Log the Grid endpoint, session ID, requested browser capabilities, test ID, timestamp, and screenshot path together. If you run separate Grids, include a deployment name as well. This makes an image self-describing even after Grid logs have rotated.

Capacity when many sessions capture at once

Grid capacity is determined by CPU, memory, browser mix, and the number and size of Nodes. Selenium’s guide gives a rough starting estimate of about one CPU and one GB of RAM per browser session. It describes an eight-CPU Node running up to eight concurrent sessions by default, except that Safari is treated as one concurrent session per Node in the described configuration. A Distributor on a four-CPU machine is described as able to create up to four sessions concurrently. These are planning examples, not performance guarantees; measure your own workload.

One large Node versus several small Nodes

Consideration One large Node Several smaller Nodes
Capacity Centralized CPU and memory pool; contention can affect many sessions. Capacity grows by adding Nodes, subject to each machine’s resources.
Isolation A host problem can affect all slots. Smaller failure domains and process isolation.
Browser and OS coverage Limited to what that host supports. Different operating systems and browser versions can be distributed.
Operations Fewer processes and endpoints to manage. More registration, monitoring, and artifact-labeling work.
Performance May be efficient for a homogeneous workload, but resource contention must be measured. Can spread load; network and scheduling overhead must be measured.

Selenium recommends small Nodes to improve process isolation, while also noting that there is no universal sizing answer. Benchmark with your page weight, browser versions, screenshot frequency, and parallelism.

Legacy multiple-Node warning

The legacy Selenium Grid 3 setup documentation warns that running multiple Nodes on one machine requires careful memory management and can produce screenshot problems. Keep that warning scoped to the legacy Grid 3 documentation. It is not evidence of a universal Selenium Grid 4 limitation. For current Grid deployments, monitor memory pressure and validate screenshots with the exact browser-driver combination you operate.

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.

Troubleshooting screenshot failures

The image is from the wrong browser

Cause: a shared or reassigned driver variable, or an artifact name that hides which session produced it.

Fix: keep one driver per worker, log session_id, and include that ID and the test case in the filename.

“Session not found” or an invalid session response

Cause: the session was quit or deleted, the Node restarted, or a stale session ID was reused.

Fix: confirm the session is still active, check Grid status, and create a new driver. Deleting a session terminates it; subsequent requests using its removed ID cannot succeed.

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

Commands wait indefinitely

Cause: no free slot, an unavailable Node, or resource exhaustion.

Fix: inspect status for Node availability, active sessions, and slots; reduce parallelism temporarily; and review host CPU and memory. Do not treat the rough one-CPU/one-GB guidance as a guaranteed capacity number.

The screenshot shows a loading page

Cause: capture occurred before the application finished rendering.

Fix: wait for a specific element or application-ready signal. Use a timeout that fails clearly, then save diagnostic logs and the session ID.

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

You cannot identify the owning Node

Cause: logs contain only a URL or test name.

Fix: record the session ID at creation, query Grid status, and use the Node session-owner endpoint. If you have independent Grids, verify that the RemoteWebDriver URL points to the intended entry point.

Grid is reachable from untrusted networks

Risk: Selenium warns that exposed Grid infrastructure can provide access to internal web applications and files or allow third parties to run binaries.

Fix: place Grid behind firewall rules and authentication controls appropriate to your environment; expose only the traffic your test workers require.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. It is the practical alternative when you want one HTTP request instead of managing browser sessions: it removes cookie/consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed; and its response identifies the result with X-Page-Verdict and X-Billed headers. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

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

Every feature is available on every plan. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Yearly billing gives two months free.

cURL

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}`);

See the ScreenshotNeo documentation for request options and response handling. You can configure full-page capture, element selectors, device and viewport settings, retina scale, PDF output, custom CSS or JavaScript, clicks, waits, blocked resources, headers, cookies, user agent, timezone, geolocation, transparent backgrounds, resizing, caching TTL, signed links, asynchronous jobs, webhooks, bulk capture (up to 100 URLs per call), usage data, and the OpenAPI specification. Parameter names used by other screenshot APIs also work, which simplifies migration.

Start with 1,000 free screenshots a month—no card required.

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

FAQ

Does Grid combine screenshots from all Nodes?

No. Each screenshot command targets one existing WebDriver session and therefore one browser on one Node.

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.

Can two sessions use the same browser type?

Yes. Grid can run multiple instances of the same browser, provided that requested capabilities fit available slots.

Should I send screenshot commands from multiple threads to one driver?

Unless your binding and framework document that pattern, avoid it and serialize commands per session.

How do I compare screenshots from two independent Grids?

Connect each test to the correct endpoint, then label artifacts with deployment, test ID, and session ID. Any aggregation or visual comparison is a responsibility of your test harness.

Frequently Asked Questions

Does Grid combine screenshots from all Nodes?

No. Each screenshot command targets one existing WebDriver session and therefore one browser on one Node.

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

Can two sessions use the same browser type?

Yes. Grid can run multiple instances of the same browser, provided that requested capabilities fit available slots.

Should I send screenshot commands from multiple threads to one driver?

Unless your binding and framework document that pattern, avoid it and serialize commands per session.

How do I compare screenshots from two independent Grids?

Connect each test to the correct endpoint, then label artifacts with deployment, test ID, and session ID. Any aggregation or visual comparison is a responsibility of your test harness.

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.

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