This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
1 / 9
Mar 2018

I want to test two android devices but I want to use same appium port. Can I use same port with two different sessions?

  • created

    Mar '18
  • last reply

    Apr '18
  • 8

    replies

  • 1.3k

    views

  • 5

    users

  • 3

    likes

  • 1

    link

No you cannot use multiple sessions on a single port for appium.

You have to start appium server at 2 different ports and use those server url in u r script to create multiple sessions or you can use grid.

@Telmo_Cardoso

By multiple session do you mean starting Appium Server on multiple ports ? If yes then this was supported in 1.6 also. If no is there any sample code to achieve that.

@Venkatesh probably its that :slight_smile: Like I told I never tested, so I’m not sure how it works, was just letting @robinvivacius know of the possibility of using one Appium server to handle multiple sessions.

But question was can we use multiple appium session on single port so answer for that still hold NO. Thanks

Yes, you can have multiple session on a single Appium server v1.7.0+ (e.g. single Appium server running on port 4723, controlling multiple device/sim, both platform droid and iOS)
You need to add additional caps as below -

  1. For Android SYSTEM_PORT
    e.g. caps.setCapability(AndroidMobileCapabilityType.SYSTEM_PORT, <unique port>);

  2. For iOS SYSTEM_PORT
    e.g. caps.setCapability(IOSMobileCapabilityType.WDA_LOCAL_PORT, <unique port>);

P.S. Tried and tested, Make sure to use a fresh instance of the Appium server on every cycle of execution.