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.

Use Selenium’s RemoteWebDriver with a Selenium Grid or a hosted provider’s WebDriver endpoint. Configure browser options—including headless mode when the remote browser supports it—start a session, run your test, and call quit() to release the session. For a local Grid, the usual standalone endpoint is http://localhost:4444; a managed service supplies its own endpoint, credentials, and capability requirements.

What “remote headless Selenium” means

A Selenium client does not need to launch a browser on the same machine where the test code runs. It sends WebDriver commands to a Grid or hosted browser service, which routes them to a browser running on a remote computer. Selenium describes Grid as routing client commands to remote browser instances; it is designed for distributing tests, including parallel runs and cross-browser or cross-platform execution. See the Selenium Grid guide and Remote WebDriver documentation.

“Headless” means the browser operates without a visible graphical window. It is a browser launch option, not a separate WebDriver connection mode. A remote service may run headless browsers, headed browsers, or both; its documentation determines whether and how to request headless mode. Do not assume that a local Chrome argument is accepted unchanged by every provider.

Choose local Grid or a hosted browser service

Consideration Self-hosted Selenium Grid Managed service
Setup and maintenance You install Java, Selenium Server, and the browser/driver stack, and operate the machines. The provider operates browser infrastructure; you configure its endpoint, credentials, and capabilities.
Browser and operating-system coverage Depends on the browser/OS combinations you install and maintain. Depends on the provider’s current matrix. BrowserStack’s current product page claims 3500+ real desktop and mobile browsers; this is the provider’s own page claim, not an independent benchmark.
Scaling and parallel sessions You provision and configure capacity. Grid is intended to distribute and parallelize remote WebDriver execution. Available concurrency and scaling depend on the service and account.
Private or staging-site access Can be placed within your network, subject to your infrastructure and security configuration. Check whether the service supports the network access method your target requires; BrowserStack documents Local testing.
Logs and debugging artifacts What you collect depends on your Grid and test setup. Logging, screenshots, video, and debugging features vary by provider and plan; check current documentation.
Regional endpoints, data handling, and cost You choose infrastructure and bear its operating costs. Endpoint regions, data terms, pricing, and plan limits are provider-specific and can change.

For a local environment, Selenium’s official Grid instructions list Java 11 or later, installed browsers and drivers, and starting a standalone server with the Selenium Server JAR. For a hosted environment, use the exact HTTPS WebDriver URL and capability syntax supplied for your account. The BrowserStack Selenium page describes desktop browser and real iOS/Android device testing, CI, and Local testing. Sauce Labs documents a hosted endpoint and capabilities in its Selenium documentation.

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

Connect to a local Selenium Grid

1. Install prerequisites and start the server

Install Java 11 or later, obtain the Selenium Server JAR, and make the browser and matching driver available to the machine that will run the browser. Selenium Manager can discover and download drivers and browsers in supported setups, reducing manual driver maintenance; see the Selenium Manager documentation. Start standalone Grid from the directory containing the JAR:

java -jar selenium-server-<version>.jar standalone

Replace <version> with the JAR’s actual version. The client endpoint for this documented standalone setup is http://localhost:4444. If the server is on a different machine or port, use the reachable URL for that Grid instead.

2. Create a Python session with headless Chrome

Install Selenium in your test environment with python -m pip install selenium. This example connects to the local Grid, asks for headless Chrome, navigates to a page, prints its title, and always attempts to close the remote session:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

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.

grid_url = "http://localhost:4444"
options = Options()
options.add_argument("--headless")

driver = webdriver.Remote(command_executor=grid_url, options=options)
try:
driver.get("https://example.com")
print(driver.title)
finally:
driver.quit()

The expected result is the page title printed by the client. The browser runs where the Grid session is allocated, not necessarily where Python runs. Keep quit() in a finally block so exceptions do not leave a session consuming Grid capacity.

3. Use another browser or viewport as needed

For another browser, use that browser’s Selenium options class and its supported headless argument, if available. Browser-specific flags are not universal capabilities. A viewport can be set with driver.set_window_size(width, height) after the session starts, though the browser or provider may impose constraints. For a non-headless test, omit the headless argument. Confirm that the browser binary, driver, and Grid node are configured for the requested browser.

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

Connect to a managed WebDriver service

A hosted service generally requires three things: its WebDriver endpoint, credentials, and a set of capabilities identifying the browser and platform. Provider-specific options may carry credentials or service settings. Never commit access keys to source control; load them from environment variables or a secret manager. Select a regional endpoint appropriate to your account and network policy.

Sauce Labs example

Sauce Labs documents https://ondemand.us-west-1.saucelabs.com:443/wd/hub, with platformName, browserName, and credentials in sauce:options. The example below shows the connection pattern; check the provider’s current capabilities and account guidance before running it:

import os
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.set_capability("platformName", "Windows 11")
options.set_capability("browserName", "chrome")
options.set_capability("sauce:options", {
"username": os.environ["SAUCE_USERNAME"],
"accessKey": os.environ["SAUCE_ACCESS_KEY"],
})

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

driver = webdriver.Remote(
command_executor="https://ondemand.us-west-1.saucelabs.com:443/wd/hub",
options=options,
)
try:
driver.get("https://example.com")
print(driver.title)
finally:
driver.quit()

Use the exact platform value, browser version, and any required option names supported for your Sauce Labs account. Add headless options only if the selected remote browser configuration supports them. Sauce Labs also documents Grid Relay, which connects Sauce as an additional node to a local Grid; this can be useful when combining a local Grid workflow with hosted capacity.

The Selenium Grid CLI options include --service-url for a WebDriver-capable service. This is useful when using Grid tooling that accepts a remote WebDriver service URL; it does not replace the credentials or provider-specific capabilities required by the service.

Common connection failures and fixes

  • Connection refused or timeout: Check that Grid is running, that the URL and port are correct, and that the client machine can reach the server. A local localhost URL refers to the client’s own machine; it will not reach a Grid running elsewhere.
  • Session not created: The requested browser may be unavailable, its version may not match the configured node, or a capability may be invalid. Verify browser availability and provider capability spelling; remove unsupported options and retry.
  • Unknown capability or invalid argument: Distinguish standard WebDriver capabilities such as browserName and platformName from provider-specific options such as sauce:options. Follow the provider’s current schema rather than guessing names.
  • Headless flag has no effect or browser exits immediately: Headless arguments belong to browser options, and their support is browser- and service-dependent. Confirm that the remote browser honors the option, and inspect Grid or provider logs for browser startup errors.
  • Test cannot reach a private staging site: The browser’s network location matters, not only the test client’s. Put a self-hosted node on a network that can resolve and reach the site, or use a provider-supported private-network/Local feature.
  • Sessions accumulate: Ensure every successful session reaches driver.quit(), including when assertions fail. A lost client connection may also leave a session until the service’s timeout policy expires it.
  • Works locally but fails in CI: Check environment-provided credentials, outbound network access to the endpoint, secret availability, and the exact browser/platform capabilities selected in CI.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability, and cost considerations

Remote execution adds network communication between the Selenium client and the browser service. Keep waits deliberate, avoid excessive polling, and make sure your test timeout budget allows for session startup and page loading. Parallel sessions can shorten suite wall time, but only when Grid or the provider has enough capacity; otherwise queueing and account limits may dominate. Selenium Grid supports distribution, but it is not itself a guarantee of a particular throughput or uptime.

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

For repeatable results, pin the browser and platform versions where the service permits, record the capabilities used, and capture failure diagnostics appropriate to your environment. Check provider documentation for logs, screenshots, video, data retention, service regions, concurrency, and current pricing before committing a workload. The implementation guides establish how to connect, not comparative benchmark performance or a universal cost advantage.

Or skip the browser setup:

If the requirement is simply to obtain a webpage screenshot or PDF—not to interact with the page as a Selenium test—ScreenshotNeo offers a screenshot API and MCP server. It is not a Selenium Grid replacement: use Selenium when you need browser automation and assertions; use a screenshot endpoint for a capture workflow.

One GET request returns a PNG, JPEG, WebP, or PDF. For example, with cURL:

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

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

See the ScreenshotNeo API documentation for parameters and response details. Cookie banners are accepted and 60+ known consent platforms, newsletter popups, and chat widgets can be removed before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, with page verdict and billing status returned in headers. Its MCP server gives AI agents tools to take screenshots, get page information, and capture PDFs. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for the free plan.

Frequently Asked Questions

Can Selenium run remotely without a display?

Yes. Connect with RemoteWebDriver and request a headless browser configuration supported by the remote Grid or service.

Does RemoteWebDriver require a local browser driver?

The browser and driver must be available to the remote browser environment. They do not necessarily need to be installed on the machine running the Selenium client.

Can Selenium Grid use a cloud browser provider?

Yes. Grid tooling can accept a WebDriver-capable service URL, and some providers also offer ways to connect their capacity to a local Grid. Follow the provider’s endpoint and capability documentation.

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.