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
I want to test two android devices but I want to use same appium port. Can I use same port with two different sessions?
In v1.7.0 (https://github.com/appium/appium/releases/tag/v1.7.068) they added:
Support multiple simultaneous sessions in Android and iOS (9+)
I never tested tho. Investigate and place your findings in this forum
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 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.
@Telmo_Cardoso OK, Thanks.
@Telmo_Cardoso thanks for this info. I’ll look in this feature
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 -
For Android SYSTEM_PORT
e.g. caps.setCapability(AndroidMobileCapabilityType.SYSTEM_PORT, <unique port>);
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.