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

To run Selenium tests in a cloud browser, create a RemoteWebDriver session instead of starting a browser on the machine running your tests. You need a remote WebDriver endpoint and browser options describing the browser you want. The endpoint can belong to a Selenium Grid you manage or a hosted browser service; the latter may require provider-specific authentication and capabilities.

How cloud browser execution works

Your test code remains on your machine or in CI, while the browser runs on a remote computer, often called an end-node. Selenium sends WebDriver commands to the remote endpoint, which starts and controls the browser. From the test’s perspective, navigation and assertions still use a WebDriver instance; the key change is how that instance is created.

Selenium’s Remote WebDriver documentation puts the requirement plainly: “To direct Selenium tests to the remote computer, you need to use a Remote WebDriver class and pass the URL including the port of the grid on that machine.” See Selenium Remote WebDriver.

  • Endpoint: the Grid or provider URL that accepts WebDriver sessions.
  • Browser options: the browser and any supported version, platform, or provider-specific settings.
  • Session lifecycle: create the remote driver, run the test, and call quit() to release the session.

Choose a self-managed Grid or a hosted browser

Use Selenium Grid when you need to manage the infrastructure

Grid is Selenium’s self-managed way to route tests to remote browser instances. It supports standalone, hub-and-node, and distributed arrangements. Standalone is the simplest starting point: the documented default endpoint is http://localhost:4444. Larger deployments can place nodes on other machines. Grid is designed for parallel execution and browser/platform coverage; see the Selenium Grid overview and Grid getting-started guide.

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

Use a hosted service when you do not want to operate browser nodes

A hosted service runs the browsers and provides a remote endpoint. You still use the Remote WebDriver pattern, but the provider determines how to authenticate, which capabilities it accepts, and how to request browser versions or platforms. Selenide’s cloud integration documentation illustrates integrations for BrowserStack, TestMu AI (formerly LambdaTest), and Sauce Labs: Selenide cloud documentation.

AWS Device Farm’s desktop browser testing guide describes obtaining a signed command-executor URL with the AWS SDK and passing that URL to RemoteWebDriver. The guide lists Chrome, Firefox, and Microsoft Edge (Chromium) on Windows for its desktop browser testing, and notes that not all W3C capabilities are implemented. Those details are specific to that service and can change; check its current support information before building against a particular browser or capability. Its desktop browser testing is billed per minute and includes video recordings and Selenium logs, according to the AWS Device Farm desktop browser testing guide.

Compare the constraints that affect your test suite

Question Why it matters
Which browser, OS, and versions are available? A test that passes on one browser/platform may not establish behavior on another. Confirm the service’s current matrix.
Which capabilities and browser features work? Provider extensions and unsupported WebDriver capabilities can affect proxies, clipboard access, downloads, and other behaviors. Selenide notes that some cloud integrations have such limitations.
How does concurrency work? Parallel sessions can shorten wall-clock suite time, but available concurrency and its cost depend on the Grid or provider arrangement.
Can the browser reach your application? Private staging sites may require a provider network feature, a VPC arrangement, or a self-managed node inside a trusted network.
What artifacts are available? Video, browser logs, and Selenium logs help diagnose remote-only failures; availability depends on the service.
How is usage billed? Check the actual plan and billing unit. AWS’s cited desktop browser guide describes per-minute billing; it does not establish prices for other providers.

Cloud execution is not automatically faster, cheaper, or compatible with every local feature. Benchmark your own suite and validate the capabilities it relies on before migrating.

Run a Selenium test against a remote browser

1. Make the test pass locally first

Confirm that the test, application, and assertions work in the local setup before changing execution location. AWS’s migration guidance also recommends observing and confirming local behavior first. Otherwise, a remote session can make an existing test problem harder to distinguish from a networking or provider issue.

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

2. Start or obtain an endpoint

For a basic self-managed Grid, follow Selenium’s getting-started setup, then use its listening endpoint. The documented standalone default is http://localhost:4444; this address is appropriate only when the client can reach that Grid on the same machine or network. For a hosted provider, use its issued endpoint and authentication instructions instead of substituting the local Grid URL.

3. Create a Java test with RemoteWebDriver

This minimal example targets a reachable Grid endpoint and requests Chrome. It uses Selenium’s Java binding; configure a current Selenium Java dependency in your project before compiling.

import java.net.URL;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.RemoteWebDriver;

public class RemoteSmokeTest {
    public static void main(String[] args) throws Exception {
        String endpoint = System.getenv().getOrDefault(
            "SELENIUM_REMOTE_URL", "http://localhost:4444");
        ChromeOptions options = new ChromeOptions();
        WebDriver driver = new RemoteWebDriver(new URL(endpoint), options);
        try {
            driver.get("https://example.com");
            System.out.println("Title: " + driver.getTitle());
        } finally {
            driver.quit();
        }
    }
}

The Java example follows Selenium’s documented RemoteWebDriver construction pattern. A hosted provider may require credentials in its endpoint, additional options, or provider-specific capabilities; follow that provider’s instructions and do not assume that every W3C capability is supported. Selenium’s Grid example describes standard capabilities such as browserVersion and platformName, as well as optional se: metadata such as a test name. Use capabilities only when the target endpoint supports them.

4. Always close the session

Call quit() in a finally block, including when an assertion or navigation fails. The remote browser consumes a session on the Grid or provider side; ending it reliably prevents abandoned sessions from using capacity or accruing usage under a provider’s billing model.

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

5. Check the remote run’s artifacts

When a test fails, inspect the Grid status/UI and available logs, or the hosted provider’s session details. AWS documents video recordings and Selenium logs for its desktop browser testing. Compare the remote browser’s actual capabilities and environment with what the test expected before changing test logic.

Handle uploads and downloads across the machine boundary

A path in test code normally names a file on the client machine, but the browser resolves paths on the remote machine. Uploading a local file therefore needs a transfer mechanism supported by the binding or provider; a client-side path does not automatically exist on the browser host.

Downloads have the inverse issue: the browser writes the file remotely. Selenium Grid can manage downloads when Grid is started with --enable-managed-downloads true and the client sets the se:downloadsEnabled capability. The client can then use Selenium’s downloadable-files interface to list and retrieve files. The returned download list is an immediate snapshot: it does not wait for an in-progress download to finish. Your test should wait for the expected download to complete before trying to retrieve it. See Selenium’s Remote WebDriver guidance.

Protect the Grid endpoint and credentials

A self-managed Grid is sensitive infrastructure, not a public service endpoint. Selenium warns that an exposed Grid can give third parties access to the infrastructure, internal applications, and files, or let them run custom binaries. Restrict it with appropriate firewall rules and allow access only from trusted clients and networks; consult the Grid security guidance.

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

For hosted execution, review session authentication, artifact retention/access, and how the service reaches private or staging applications. AWS documents VPC support for its desktop browser testing and advises least-privilege AWS credentials for SDK/CLI access in its Device Farm guide. Keep signing credentials out of source code and logs.

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

Troubleshoot common remote-session failures

  • Connection refused or timeout at session creation: Confirm the endpoint and port, that Grid is running, and that the client can reach it through its network and firewall. A local localhost endpoint will not identify a Grid running on another host.
  • Session creation rejects capabilities: Remove unsupported options or use the exact provider namespace and capability format documented by the service. A browser/platform combination may not be available even when the browser itself is supported.
  • Browser cannot open a staging URL: The browser host, not just the test client, must be able to reach the application. Check DNS, access controls, and the provider’s private-network setup.
  • Test passes locally but fails remotely: Compare requested and actual browser/platform versions, time zone, network access, and feature support. Use the session logs or video if the service provides them, then separate environment differences from test synchronization problems.
  • Upload reports a missing file: The browser host cannot necessarily see the client’s filesystem. Use the binding’s or provider’s supported file-transfer mechanism.
  • Download retrieval returns no file: The browser writes remotely, and Grid’s managed-download listing is an immediate snapshot. Enable managed downloads and se:downloadsEnabled, wait for completion, then list and retrieve.
  • Sessions remain active after a failed test: Put driver.quit() in a finally block so exceptions do not skip cleanup.

Or skip the browser setup

If your goal is a page screenshot rather than an interactive Selenium test, ScreenshotNeo is a website screenshot API and MCP server, not a WebDriver replacement. One GET request captures a URL as PNG, JPEG, WebP, or PDF. For example, using cURL:

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

See the ScreenshotNeo API documentation for parameters and response details. Cookie/consent banners, newsletter popups, and chat widgets are removed before capture; those cleanup steps can be turned off. Bot checks, blank pages, failed loads, and cache hits are not billed, with response headers indicating the page verdict and billing status. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots. For interactive browser tests, continue using Selenium and a Grid or hosted WebDriver service. Sign up for ScreenshotNeo’s free plan.

Frequently asked questions

Does the browser run on my test machine?

No. With RemoteWebDriver, test code runs on the client while the browser runs on the remote computer or end-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 a cloud browser test download files to my laptop automatically?

Not by ordinary local path alone: the browser writes on its remote host. Use the remote-download handling supported by Grid or the provider to retrieve files to the client.

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.