How to run appium test on multiple devices?

How to run the same appium test on multiple devices?

1 Like

There is an open source framework built on top of appium that does this out of the box. Have a look at it here

Open Multiple Insatnces of Appium and Use different port and host in Appium server. @jitenderbhardwaj

@s10v10s Can you give me some idea about it? I don’t know how to achieve this.

@sukesh15 Thanks. I will try it!

@jitenderbhardwaj If you are using optimus, it takes care of starting multiple instances of appium servers on different ports. So you could just connect the devices that you want to run test on, and tests will be run in parallel on them.

just open new application of appium and It will open 2 appium instances @jitenderbhardwaj

Hi there,

When trying to connect more than 4 Android devices, the log doesn’t show more than 4 appium servers being initialized. The fifth one seems like it’s being taken over due to a socket error being ended by another session. Please help :slight_smile:

[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“element:getAttribute”,“params”:{“attribute”:“className”,“elementId”:“8”}}
[MJSONWP] Encountered internal error running command: Error: Android bootstrap socket crashed: Error: This socket has been ended by the other party
at Socket. (…/…/lib/bootstrap.js:87:21)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Socket.writeAfterFIN [as write] (net.js:294:8)
at …/…/lib/bootstrap.js:112:25
at Promise.F (C:\Users\pmadeya\AppData\Roaming\npm\node_modules\appium\node_modules\core-js\library\modules$.export.js:30:36)
at AndroidBootstrap.sendCommand$ (…/…/lib/bootstrap.js:108:18)

@pmadeya
Can you share your script with me for connecting four Android devices. I tried but failed.

Not working.
Giving me error:
‘optimus’ is not recognized as an internal or external command,
operable program or batch file.

Have you installed the optimus-cli utility?

yes.
But when i entered: optimus doctor then i got: ‘optimus’ is not recognized as an internal or external command,
operable program or batch file.