Testing Real-Time User Interaction Using Multiple Simultaneous Appium Sessions

March 21, 2026 · 12 min read · Tool Comparison

HeadSpin Platform
Automated & amp; manual testing get easy through data skill penetration.
Differentiating capacity:
  • Extensive end-to-end mechanization of QA process
  • Comparative analysis of app performance against match
  • Continuous monitoring of app performance using synthetic datum for higher accessibility of apps
  • Easy-to-use developer friendly platform
cloudtest go
Affordable Real Device Testing for Emerging Teams
cloudtest go
Low-priced Real Device Testing for Digital Enterprises
cloudtest go
The Ultimate Solution for a Powerful Blend of Functional & amp; Performance Testing!
cyol
TEM
New
Centralized wandering test execution in cloud
cyol
Enhance Your Accessibility Testing With HeadSpin
cyol
Automate camera-based testing

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

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

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

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

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

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

retail

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

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

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

Testing Real-Time User Interaction Using Appium SessionsTesting Real-Time User Interaction Using Appium Sessions

Testing Real-Time User Interaction Using Multiple Simultaneous Appium Sessions

Published on
June 4, 2020
Updated on
Published on
January 24, 2022
Updated on
 by 
 Jonathan LippsJonathan Lipps
Jonathan Lipps
Two Appium Devices

Many of the apps that we use, and take to test, involve the real-time interaction of multiple exploiter, who are sitting in front of their own device or browser. The & quot; standard & quot; Appium exam involves one driver aim, representing one Appium session, automate a single device. How can we extend our usage of Appium so that we canco-ordinatemultiple devices, the way multiple users would spontaneously coordinate their own behavior?

Examples of multi-user interaction

First, let & # x27; s take a look at some common use instance for a multi-user or multi-device examination:

  1. A chat application involving one or more users interact in real clip
  2. A ridesharing app, involving two parties -- -the rider, who requests a ride using an app, and the driver, who can accept and pluck up a rider use the same app. Rider and driver stay in constant interaction through the updating of a map that shows their position.
  3. A food delivery app, involving three parties -- -the someone requesting the food, the restaurant preparing the nutrient, and the bringing person who pluck up the nutrient from the restaurant and delivers it to the requester.

Of course, lots of other apps involve user interaction that isn & # x27; t necessarily real-time. Any social app, for example, will have the ability for users to care or comment on other users & # x27; situation. In a normal case, it would be potential to conceive of this as pass asynchronously, not in real time. But many of these like apps too desire to be able to test that the UI is updated in real time, when another user interacts with some content. So, for model, when I & # x27; m using Twitter, I get an in-app notification (rather than a system notice), if someone likes or retweets one of my situation. Testing this peculiar feature expect the like kind of multi-user interaction we & # x27; re talking about here.

Background for a multi-device flow

The basic point I want to convey in this guide is thatAppium needs no particular help to accommodate a multi-device, multi-user, real-time test scenario. This is true because of the following facts about Appium (which you might already be aware of):

  1. Appium sessions are represented by objects in your examination codification. There & # x27; s nothing to stop you from having multiple such objects.
  2. Appium servers can handle multiple coincidental sessions (with appropriate config to make certain session don & # x27; t step on each other & # x27; s toes).

These two facts make it technically trivial (if not incessantly intuitive from a test development perspective) to implement real-time multi-device stream. Now, there is a little caveat on number 2 above -- -because Appium sessions utilize certain scheme resource (primarily TCP ports) to communicate with specific device, if you want to run multiple Appium sessions at erstwhile on a individual machine, you & # x27; ll postulate to include some capabilities that direct Appium to use specific ports for each session. This information has already be covered in the Appium Pro article on. There is no difference from Appium & # x27; s view between the like examination being run in analog on different devices, or one test incorporating multiple devices to test a user interaction flow.

Our multi-user AUT

SUSA automates exploratory testing with persona-driven behavior, catching bugs that scripted automation misses.

To showcase multi-device examine with Appium, I developed a simple chat application, calledAppium Pro Chat. It & # x27; s a non-persisent multi-channel chat room, with zero memory, data storage, or (I hesitate to add) security. Feel gratis to go try it out in your browser! You can open up two browsers or tabs, cull a username, and join the same channel to see it in activity. The basic test that I will implement is this:

  1. User 1 picking a username and join a channel
  2. User 2 pick a username and join the same groove as User 1
  3. User 1 and User 2 both type things into the chat
  4. Assert that the final confab log contains both of their messages in the right order

It & # x27; s a bare tryout, but one that has to affect the coordination of multiple Appium devices and multiple Appium sessions.

Multi-device setup

For this example, I am going to use an iOS simulator for User 1, and an Android device (Galaxy S7) for User 2. The initiative thing I need to do is make sure that I can begin an Appium session on each of these, so I & # x27; ve create a helper method for each that only returns an Appropriate driver case.

private IOSDrivergetSafari () throws MalformedURLException {DesiredCapabilities capabilities = new DesiredCapabilities (); capabilities.setCapability (`` platformName '', `` iOS ''); capabilities.setCapability (`` platformVersion '', `` 13.3 ''); capabilities.setCapability (`` deviceName '', `` iPhone 11 ''); capabilities.setCapability (`` browserName '', `` Safari ''); capabilities.setCapability (`` automationName '', `` XCUITest ''); retrovert new IOSDriver < > (new URL (`` http: //localhost:4723/wd/hub ''), capableness);} individual AndroidDrivergetChrome () throws MalformedURLException {DesiredCapabilities capabilities = new DesiredCapabilities (); capabilities.setCapability (`` platformName '', `` Android ''); capabilities.setCapability (`` deviceName '', `` Android Emulator ''); capabilities.setCapability (`` browserName '', `` Chrome ''); capabilities.setCapability (`` automationName '', `` UiAutomator2 ''); return new AndroidDriver < > (new URL (`` http: //localhost:4723/wd/hub ''), capabilities);}

Now, in my test setUp method, I make sure to instantiatebothdriver, which are store as fields in my form, for example (omitting the other features of this class):

public class Edition118_Multi_Device {private IOSDriversafari; private AndroidDriverchrome; @ Before public vacancy apparatus () throws MalformedURLException {safari = getSafari (); chrome = getChrome ();} @ After public void tearDown () {if (safari! = null) {safari.quit ();} if (chrome! = null) {chrome.quit ();}}}

You can see that there & # x27; s nothing exceptional to get multiple sessions depart at the same time -- -I just first create the session on Safari on iOS, so the one on Chrome on Android. Setup and teardown now handle two driver, instead of one. In this instance, I am instantiating these sessions serially; if I wanted to optimize further, I could potentially instantiate them at the like clip in separate threads, but it impart unnecessary complexity at this point.

Coordinating multiple driver within a single test

Now, we need to use both of these drivers (the safari and chrome objects) in such a way that they interact in real time with one another, in the course of a single trial. Before I show the test method itself, I & # x27; ll excuse the plan: each of the two user will merchandise line from the knock-down Langston Hughes poemHarlem. To encapsulate the data which will be used to support the test, we & # x27; ll add it all as a set of fields at the top of the course:

private static final String CHAT_URL = `` https: //chat.appiumpro.com ''; individual static final String CHANNEL = `` Harlem ''; private electrostatic final String USER1_NAME = `` Langston ''; private static final String USER2_NAME = `` Hughes ''; individual static final ImmutableListUSER1_CHATS = ImmutableList.of (`` What hap to a dream postpone? ``, `` Or fester like a sore -- -and then run? ``, `` Or freshness and sugar over -- -like a syrupy sweet? ``, `` Or does it explode? ``); private static terminal ImmutableListUSER2_CHATS = ImmutableList.of (`` Does it dry up like a raisin in the sun? ``, `` Does it reek like rotten pith? ``, `` Maybe it just sags like a heavy load. ``, `` ........ yes '');

(Note that I have, possibly ill-advisedly, but I believe in line with the feeling of the poem, impart a final line of my own, partly to get User 2 & # x27; s list of messages equalize the length of User 1 & # x27; s). With the data set up in ImmutableLists, we & # x27; re in a position to iterate over the chats and implement the user interaction in a very concise way.

Next, I wanted to create a set of helper method to make it potential to reuse functionality between the two users. Both users will have to login and join a groove, and both users will have to send messages. Likewise, we can read the chat log from the perspective of either user. So we can factor all of this out into appropriate helper method:

individual void joinChannel (RemoteWebDriver driver, String username, String channel) throw MalformedURLException {WebDriverWait wait = new WebDriverWait (driver, 10); driver.navigate () .to (new URL (CHAT_URL)); wait.until (ExpectedConditions.presenceOfElementLocated (By.cssSelector (`` # channel ''))) .sendKeys (channel); driver.findElement (By.cssSelector (`` # username '')) .sendKeys (username); driver.findElement (By.cssSelector (`` # joinChannel '')) .click ();} individual void sendChat (RemoteWebDriver driver, String message) {WebDriverWait wait = new WebDriverWait (driver, 10); wait.until (ExpectedConditions.presenceOfElementLocated (By.cssSelector (`` # sendMessageInput ''))) .sendKeys (content); driver.findElement (By.cssSelector (`` # sendMessageBtn '')) .click ();} private String getChatLog (RemoteWebDriver driver) {WebDriverWait wait = new WebDriverWait (driver, 10); return wait.until (ExpectedConditions.presenceOfElementLocated (By.cssSelector (`` # messages ''))) .getText ();}

Note that each of these lead a RemoteWebDriver object, because that is the appropriate superclass of both IOSDriver and AndroidDriver. We don & # x27; t know within these methods whether we & # x27; re automating iOS Safari or Android Chrome, and that & # x27; s a full thing. It maintain the code general.

Now, we can encrypt up the test itself:

@ Test public nothingness testChatApp () throws MalformedURLException {joinChannel (safari, USER1_NAME, CHANNEL); joinChannel (chrome, USER2_NAME, CHANNEL); for (int i = 0; i< USER1_CHATS.size(); i++) {
        sendChat(safari, USER1_CHATS.get(i));
        sendChat(chrome, USER2_CHATS.get(i));
    }
    System.out.println(getChatLog(chrome));
    try { Thread.sleep(4000); } catch (Exception ign) {}
}

As you can see, it & # x27; s fairly stocky. We induce each of the clients to join the same groove, then iterate over their various list of chat messages, sending each one to the groove. Finally, I retrieve the chat log from one of the users, and print it out to the console. Of course, in an actual tryout, we could make assertions on the substance of the messages box, or yet assert appropriate similarity between the chat lumber see by each user. Finally, for visual impact while running the tryout, we wait for 4 seconds before close everything down (again, this would not be the cause in an actual test).

Recap

That & # x27; s really all there is to it! Let me highlight the scheme we & # x27; ve direct hither, in a way that could be adapted to any multi-user flow:

  1. Define the number of users involve for the test.
  2. In setup, instantiate one Appium driver object for each participating user, taking care to postdate all the rules for running Appium sessions in parallel.
  3. In the tryout itself, interleave commands for the freestanding drivers, following the logic of an actual user flow (usually these occur serially, since behavior for one user is dependent on doings for another user, but if potential and appropriate, bid could run simultaneously in different threads).
  4. In teardown, make sure to pick up all the drivers.

Want to have a look at the full codification sampling for this multi-user flow?Check it out on GitHub! And by all agency, let me know if you & # x27; ve implemented any interesting multi-user or multi-device flow with Appium.

Author & # x27; s Profile

Jonathan Lipps

LinkedIn
Author & # x27; s Profile

Piali Mazumdar

Lead, Content Marketing, HeadSpin Inc.

Piali is a dynamic and results-driven Content Marketing Specialist with 8+ years of experience in crafting engaging narratives and marketing collateral across diverse industry. She excels in collaborating with cross-functional teams to germinate innovative substance strategies and deliver compelling, veritable, and impactful content that resonates with target hearing and enhances make authenticity.

LinkedIn

Testing Real-Time User Interaction Using Multiple Simultaneous Appium Sessions

4 Parts

regression intelligence blog
-

Regression Intelligence practical guide for forward-looking users (Part 3)

Coming Soon
Regression Intelligence practical guide for advanced users
-

Regression Intelligence practical guide for forward-looking users (Part 4)

Coming Soon

Discover how HeadSpin can empower your business with superior examine capabilities

Our Platform enable you to:
accelerate time-to-market
Accelerate time-to-market, derive a competitive edge
faster development cycles
Boost developer/QA productivity with faster evolution cycles
automated buil-over-build regression testing
Automate build-over-build regression testing for consistent results
gain better visibility into functional & performance issues
Gain better visibleness into functional and execution issue
reduce mean time
Reduce meanspirited time to identify/resolve during exam, QA, and product
evaluate audio, video & qoe
Evaluate audio, picture, and content quality of experience (QoE) effortlessly
The trusted choice for global enterprises
Adobe
Hargreaves Lansdown
Truecaller
Crazylabs
Nedbank
Numeracle
Veryon
Close

Discover how HeadSpin can empower your business with superior essay capableness

Our Platform enables you to:
accelerate time-to-market
Accelerate time-to-market, gaining a competitive edge
faster development cycles
Boost developer/QA productivity with faster growing cycles
automated buil-over-build regression testing
Automate build-over-build regression testing for logical results
gain better visibility into functional & performance issues
Gain best visibility into functional and performance matter
reduce mean time
Reduce mean time to identify/resolve during test, QA, and production
evaluate audio, video & qoe
Evaluate audio, video, and content quality of experience (QoE) effortlessly
The trusted option for global endeavour
Close

Discover how HeadSpin can empower your line with superior testing capabilities

Our Platform enable you to:
accelerate time-to-market
Accelerate time-to-market, gaining a competitory edge
faster development cycles
Boost developer/QA productivity with faster development cycle
automated buil-over-build regression testing
Automate build-over-build regression testing for consistent results
gain better visibility into functional & performance issues
Gain best profile into functional and performance issues
reduce mean time
Reduce base clip to identify/resolve during trial, QA, and production
evaluate audio, video & qoe
Evaluate audio, video, and contented quality of experience (QoE) effortlessly
The trusted choice for global 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