The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
If Appium raises org.openqa.selenium.remote.UnreachableBrowserException while getScreenshotAs (or an equivalent screenshot command) runs, treat it first as a session-transport failure—not as an image-format problem. The client can still reach the Appium server while the browser, device driver, webview, or cloud endpoint behind that session has stopped listening. Find the endpoint named in the nested error, verify the server, driver, device and capabilities, then create a new session after correcting the configuration.
What “browser unreachable” means in Appium
Appium is a chain: your test client talks to an Appium server; the server delegates to a platform driver; that driver controls a device, browser or app. A screenshot request travels through the same chain. If any downstream link is unavailable, Selenium reports UnreachableBrowserException.
In one Appium Discuss trace, session creation ended with Connection refused to 127.0.0.1 on a dynamically assigned port. Appium itself was running, but the downstream browser or driver endpoint was not. A separate screenshot report on Stack Overflow reached the same exception because a cloud provider required a host capability containing its cloud URL; adding that provider-specific value restored capture.
Therefore, the endpoint in the exception is not necessarily the port where Appium is listening. “Connection refused” means the address is unavailable or no process is accepting connections. “No route found” commonly means the client is using the wrong server URL or a route that the active server does not expose.
#1 Best Overall
Fix the error in this order
- Record the complete exception and server log. Copy the nested cause, not only the final Selenium line. Note every host, port, URL, context and timestamp shown around session creation and screenshot capture.
- Confirm the Appium URL and process. Compare the URL in your client with the server you intentionally started. Stop stale Desktop and CLI instances, then run only the intended server. A client aimed at an old port can produce a healthy-looking server message followed by an unreachable-browser error.
- Verify the driver and target. The current Appium quickstart requires Appium, an Appium driver and its dependencies, a client library, and a test script. Confirm that the selected driver is installed for your Appium version, the device is visible to the host, and the browser or app is installed and launchable.
- Rebuild capabilities with W3C namespacing. Use a minimal set, create a new session, and only then retry the screenshot. Capabilities are fixed for the lifetime of a session; editing a live session cannot repair it.
- Check context and timing. If the session survives, verify that the intended context still exists after switching between
NATIVE_APPand a web context. Wait for the page or app transition to settle before capture. - Escalate the infrastructure. If local routing or device availability repeatedly fails, use an Appium-compatible hosted device lab and follow its current capability schema.
1. Confirm the server URL and downstream endpoint
Distinguish Appium’s listening port from the failing port
Read the error from the inside out. The Appium URL configured in the client may be reachable, while a dynamically assigned driver port, a webview debugging endpoint, or a provider URL is not. Test the exact host and port named in the nested cause from the same machine or runner that executes the test.
- Connection refused: the address is wrong, the process exited, or nothing is listening.
- No route found: the client is using an unavailable route or server URL.
- Cloud URL mismatch: the provider endpoint or required host capability is missing or incorrect.
Restarting Appium without correcting the endpoint usually leaves the underlying failure unchanged. Make sure only the intended server is running and that your test does not retain a stale session URL.
2. Verify driver, device and browser readiness
Driver installation
Appium’s quickstart puts driver installation and dependencies before writing a test. Check that the driver named by your capabilities is installed and compatible with the Appium version in use. A server process can start successfully even when the requested driver cannot create a usable browser session.
Android and iOS targets
Confirm that the device is connected and visible to the host, remains unlocked where required, and has the target browser or application installed. For iOS XCUITest, Appium recommends representing the target with at least one of browserName, appium:app or appium:bundleId, so the driver knows what to install or launch.
Rank #2
Cloud devices
Cloud vendors add their own capability namespaces and endpoint rules. The documented screenshot-specific Perfecto case required a host capability containing the cloud URL. Treat that as a provider requirement, not a universal Appium setting; consult the provider’s current schema and URL format.
3. Use a minimal W3C capability set
Standard fields include platformName, browserName and browserVersion. Appium-specific fields must use the appium: prefix, including appium:automationName, appium:udid and appium:app.
{
"platformName": "Android",
"appium:automationName": "UiAutomator2",
"appium:udid": "DEVICE_ID",
"browserName": "Chrome"
}
Adapt the names and values to your driver and provider. For an application rather than a mobile browser, use the appropriate appium:app or appium:bundleId. For a hosted service, add its documented vendor object and any required host or URL field.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchAfter changing capabilities, terminate the old session and create a completely new one. Appium documents capabilities as the core parameters used to start a session and states that they cannot be changed after the session starts.
4. Capture only after the session and context are alive
Check the current context
A session can be alive while the context you selected has disappeared. Before a screenshot, list or inspect available contexts, then select the intended web context or NATIVE_APP. A context switch to a dead webview can look like a browser-unreachable failure.
Wait for transitions, not arbitrary delays
Wait for the page or app state you actually need: a known selector, a completed navigation or a settled app transition. If the browser process has exited, extra delays and screenshot retries will not revive it; restart the session and fix the driver, device or endpoint cause.
Use a fresh screenshot call
Once the session is recreated and the context is confirmed, issue the normal Appium/Selenium screenshot command used by your client. Save the response locally and inspect the server log at the exact capture time. A successful session creation does not prove that the browser remains available later.
Read the Appium log instead of guessing
Capture the complete server log from session creation through the failed screenshot. Search for:
Connection refusedorNo route found;- a driver process exit or crash;
- device disconnects, USB or transport loss;
- webview context disappearance;
- cloud endpoint or host-capability mismatches;
- timeouts during navigation or page loading.
The final exception is a wrapper. The nested error usually identifies the address that failed and determines which branch of the diagnosis applies.
Common symptoms and precise fixes
| Symptom | Likely cause | Action |
|---|---|---|
Appium starts, then screenshot reports Connection refused |
Wrong or dead downstream driver/browser port | Use the host and port in the nested cause; verify the driver process and recreate the session. |
No route found |
Incorrect server URL or route | Compare the client URL with the one intentional Appium instance and remove stale sessions. |
| Only cloud runs fail | Provider endpoint or capability schema mismatch | Use the provider’s current URL and vendor namespace; add required fields such as the documented Perfecto host value when applicable. |
| Failure follows a web/native switch | Dead or missing webview context | Inspect available contexts, select a live one, wait for the transition, or restart the session. |
| Changing capabilities has no effect | Capabilities are immutable after session creation | End the session and create a new one with the corrected W3C fields. |
| Local device repeatedly vanishes | Unstable device or local transport | Check device visibility and driver logs; move the run to a managed Appium cloud lab if local routing remains unreliable. |
When a hosted Appium device lab is appropriate
A hosted lab is an escalation option when local devices, routing or browser endpoints are the recurring bottleneck—not a guaranteed cure for every screenshot exception. Appium’s cloud guidance names HeadSpin, Sauce Labs and BrowserStack as examples of providers with their own capability namespaces. Check each vendor’s current Appium version support, driver availability, host URL format and commercial terms before moving a workload.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
If you only need a clean website image rather than an interactive mobile-device session, ScreenshotNeo makes one GET request to return PNG, JPEG, WebP or PDF. It accepts cookie and consent banners like a visitor, then removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each step can be disabled.
Free tools Windows power users keep installed
One-click scans. No signup required.
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 documentation for parameters and response details. The same request in 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)
And in 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}`);
ScreenshotNeo bills only clean shots. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits cost nothing, and response headers identify the page verdict and whether it was billed. Its MCP server provides take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.
FAQ
Is this error always caused by Selenium?
No. The exception is a transport/session-liveness wrapper. The nested endpoint error may identify Appium routing, a driver process, a device, a webview or a cloud service.
Will adding a sleep before the screenshot fix it?
Only if the session is alive and the page is still transitioning. A refused connection, dead browser or missing route requires endpoint or session repair, not a longer delay.
Recommended Free Tools
Can I repair capabilities without restarting?
No. Capabilities are fixed when the Appium session starts. End the session and create a new one with corrected namespacing and values.
Frequently Asked Questions
Which log line should I share when asking for help?
Share the complete server and client output around session creation and screenshot time, including the nested cause, host, port, URL, driver name, platform and context. Redact credentials and tokens.
Do all Appium drivers use the same browser capability?
No. The standard fields are shared, but the target requirements and Appium-specific capabilities depend on the driver and platform. XCUITest, for example, expects a browserName, appium:app or appium:bundleId target.
Quick Recap
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.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.

