Connecting Directly to Appium Hosts in Distributed Environments

May 19, 2026 · 10 min read · Tool Comparison

HeadSpin Platform
Automated & amp; manual testing made easy through data science insights.
Differentiating capabilities:
  • Extensive end-to-end automation of QA procedure
  • Comparative analysis of app performance against peers
  • Uninterrupted monitoring of app performance expend synthetic data for high availability of apps
  • Easy-to-use developer friendly platform
cloudtest go
Low-cost Real Device Testing for Emerging Teams
cloudtest go
Affordable Real Device Testing for Digital Enterprises
cloudtest go
The Ultimate Solution for a Powerful Blend of Functional & amp; Performance Testing!
cyol
TEM
New
Centralized mobile test execution in cloud
cyol
Enhance Your Accessibility Testing With HeadSpin
cyol
Automate camera-based testing

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

retail

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

Connecting Directly to Appium Hosts in Distributed EnvironmentsConnecting Directly to Appium Hosts in Distributed Environments

Connecting Directly to Appium Hosts in Distributed Environments

Published on
September 11, 2019
Updated on
Published on
March 8, 2022
Updated on
 by 
 Jonathan LippsJonathan Lipps
Jonathan Lipps

This edition of Appium Pro is in many means the sequel to the early clause on. In that article, we saw one way of have around network latency, by combining many Appium commands into one network request to the Appium server.

When using a cloud service, however, there might be other network-related topic to worry approximately. Many cloud services adopt the standard Webdriver/Appium client/server model for running Appium tests. But because they host hundreds or thousands of devices, they & # x27; ll be lead a very high number of Appium servers. To reduce complexity for their users, they often provide a individual entry point for starting sessions. The users & # x27; request all come to this single entry point, and they are proxied on to the appropriate Appium server ground on the user & # x27; s authentication detail and the session ID. In these scenarios, the single entry point acts as a kind of Appium load balancer, as in the diagram below:

Cloud provider with a load balancer

This poser is great for making it easy for exploiter to connect to the service. But it & # x27; s not necessarily so outstanding from a test performance perspective, because it frame an additional HTTP request/response in between your test client and the Appium server which is finally handling your client & # x27; s commands. How big of a deal this is count on the physical organization of the cloud service. Some cloud keep their load balancers and devices all together within one physical datacenter. In that case, the extra HTTP call is not expensive, because it & # x27; s local to a datacenter. Other cloud provider emphasize geographical and net distribution, with real device on real networks scattered all over the reality. That latter scenario implies Appium serversalsoscattered around the world (since Appium servers must be scarper on horde physically connected to devices). So, if you want both the convenience of a single Appium endpoint for your exam book plus the benefit of a highly distributed gimmick cloud, you & # x27; ll be pay for it with a bunch of extra latency.

Well, the Appium team truly doesn & # x27; t like unneeded latency, so we thought of a way to fix this small job, in the form of what we calldirect connectcapabilities. Whenever an Appium server last starting up a session, it send a reaction backwards to your Appium client, with a JSON object containing the capabilities the server provides (usually it & # x27; s just a copy of whatever capabilities you sent in with your session request). If a cloud service implements direct connect, it will add four new capabilities to that list:

  • directConnectProtocol
  • directConnectHost
  • directConnectPort
  • directConnectPath

Pro tip: Tools like SUSA can handle this autonomously — upload your app and get results without writing a single test script.

These capabilities will encode the locating and access information for anon-intermediaryAppium server -- the one actually handling your test. Now, your client had connected to the Appium shipment balancer, so it doesn & # x27; t know anything about the host and porthole of the non-intermediary Appium server. But these capabilities yield your client that info, and if your client also supports direct connect, it will parse these capabilities automatically, and control that each subsequent bid gets direct not to the load balancer but directly to the Appium server which is handling your session. At this point in time, the official Appium Ruby and Python libraries back direct connect, as well as WebdriverIO -- support for other clients arrive soon.

It & # x27; s essentially what & # x27; s depicted in the diagram below, where for every command after the session initialization, HTTP request are made directly to the final Appium waiter, not to the load balancer:

Cloud provider with direct connect

The nearly beautiful thing about this whole feature is that you don & # x27; t even need to cognise about direct connect for it to work! It & # x27; s a passive client feature that will work as long as the Appium cloud service you use has implemented it on their end as easily. And, because it & # x27; s a new characteristic all around, youmayhave to become on a flag in your client to signal that you need to use this feature if available. (For example, in WebdriverIO, you & # x27; ll need to add the enableDirectConnect option to your WebdriverIO config file or object.) But beyond this, it & # x27; s all automatic!

The only other thing you might want to worry about is your corporate firewall -- if your security team has allowed connections explicitly to the shipment balancer through the firewall, but not to other hosts, then you may run into issues with commands being blocked by your firewall. In that lawsuit, either have your protection team update the firewall rules, or turn off direct connect so your commands don & # x27; t miscarry.

Direct Connect in Action

To figure out the actual, practical benefit of direct connect, I again engaged in some experiment using HeadSpin & # x27; s device cloud (HeadSpin helped with implementing direct connect, and their cloud currently indorse it).

Here & # x27; s what I found when, from my office in Vancouver, I ran a bunch of tests, with a cluster of commands, with and without unmediated connect, on devices sit in California and Japan (in all cases, the lading balancer was likewise located in California):

Devices Using Direct Connect? Avg Test Time Avg Command Time Avg Speedup
Cali No 72.53s 0.81s
Cali Yes 71.62 0.80s 1.2%
Japan No 102.03s 1.13s
Japan Yes 70.83s 0.79s 30.6%

Analysis

What we see here is that, for tests I ran on devices in California, direct connect added simply marginal benefit. Itdidadd a fringy benefit with no downside, so it & # x27; s withal a nice little bump, but because Vancouver and California are pretty close, and because the load balancer was geographically quite close to the remote devices, we & # x27; re not gaining very much.

Looking at the effects when the devices (and therefore Appium server) are located much further away, we see that direct connect provides a really substantial acceleration of about 30 %. This is because, without direct connect, each bid must travel from Vancouver to California and then on to Japan. With unmediated connect, we not only cut out the jobber in California, but we likewise avoid build another unhurt HTTP request along the way.

Test Methodology

(The way I ran these tests was basically the like as the way I ran tests for)

  • These examination be run on real Android devices hosted by HeadSpin around the creation on existent networks, in Mountain View, CA and Tokyo, Japan.
  • For each test condition (fix and use of direct connect), 15 distinct examination were run.
  • Each test consisted of a login and logout stream repeated 5 multiplication.
  • The total number of Appium commands, not counting session start and quit, was 90 per test, meaning 1,350 overall for each test condition.
  • The numbers in the table discard session start and quit time, counting simply in-session examination time (this means of course that if your tests lie primarily of session start time and incorporate real few commands, then you will get a proportionally small benefit from optimise utilize this new lineament).

Conclusion

You may not notice yourself in a position where you need to use direct connect, but if you & # x27; re a regular user of an Appium cloud supplier, make certain to ascertain in with them to ask whether they support the feature and whether your test situation might benefit from the use of it. Because the lineament needs to be enforce in the burden balancer itself, it & # x27; s not something that you can take advantage of by using open source Appium directly (although, it would be great if someone built support for direct connect as a Selenium Grid plugin!) Still, as use of devices locate around the world becomes more mutual, I & # x27; m felicitous that we have at least a partial solution for decimate any unneeded latency.

Author & # x27; s Profile

Jonathan Lipps

LinkedIn
Author & # x27; s Profile

Piali Mazumdar

Lead, Content Marketing, HeadSpin Inc.

Piali is a dynamical and results-driven Content Marketing Specialist with 8+ years of experience in crafting engaging narratives and marketing collateral across diverse industries. She excels in collaborating with cross-functional teams to evolve innovative content strategies and deliver compelling, authentic, and impactful substance that resonates with target audience and enhances brand authenticity.

LinkedIn

Connecting Directly to Appium Hosts in Distributed Environments

4 Parts

regression intelligence blog
-

Regression Intelligence pragmatic guide for innovative exploiter (Part 3)

Coming Soon
Regression Intelligence practical guide for advanced users
-

Regression Intelligence practical guide for innovative users (Part 4)

Coming Soon

Discover how HeadSpin can authorise your business with superior testing capabilities

Our Platform enables you to:
accelerate time-to-market
Accelerate time-to-market, gaining a competitive edge
faster development cycles
Boost developer/QA productiveness with quicker maturation round
automated buil-over-build regression testing
Automate build-over-build fixation testing for reproducible resultant
gain better visibility into functional & performance issues
Gain better visibility into functional and performance issues
reduce mean time
Reduce mean time to identify/resolve during test, QA, and product
evaluate audio, video & qoe
Evaluate audio, video, and content quality of experience (QoE) effortlessly
The trusted choice for world-wide enterprise
Adobe
Hargreaves Lansdown
Truecaller
Crazylabs
Nedbank
Numeracle
Veryon
Close

Discover how HeadSpin can indue your business with superior testing potentiality

Our Platform enable you to:
accelerate time-to-market
Accelerate time-to-market, win a competitive edge
faster development cycles
Boost developer/QA productivity with faster development cycles
automated buil-over-build regression testing
Automate build-over-build fixation testing for consistent results
gain better visibility into functional & performance issues
Gain best visibility into functional and performance number
reduce mean time
Reduce average time to identify/resolve during test, QA, and product
evaluate audio, video & qoe
Evaluate sound, picture, and contented quality of experience (QoE) effortlessly
The trusted choice for global enterprises
Close

Discover how HeadSpin can empower your job with superior screen capabilities

Our Platform enable you to:
accelerate time-to-market
Accelerate time-to-market, win a competitive edge
faster development cycles
Boost developer/QA productiveness with quicker development cycles
automated buil-over-build regression testing
Automate build-over-build regression test for consistent results
gain better visibility into functional & performance issues
Gain better visibility into functional and performance issues
reduce mean time
Reduce average time to identify/resolve during test, QA, and product
evaluate audio, video & qoe
Evaluate audio, picture, and content quality of experience (QoE) effortlessly
The trusted selection for spherical enterprises
Close

Connet Now

Wipro LogoVMLYR Logo
Close
Book a Meeting
Products
footer down arrow
Solutions
footer down arrow
Industries
footer down arrow
Features
footer down arrow
Support
footer down arrow
Resource Center
footer down arrow
Why Choose HeadSpin?
footer down arrow
Copyright © 2026 HeadSpin, Inc. All Rights Reserved.

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free