How to run test case in sequence on 2 devices

Hi all,
Iam testing an app chat like wechat. Account01 send message to Account02.
My test case will be run like below :

  • Open app on account01 and send a message to account02.
  • Open app on account02 to verify receiving message succesfully.
    I try to sett up and open 2 appium servers with different port bootrat and port appium server.

and our simple below script is : first just open app in device 01 then open app in device 02.

But , when the script run, it only open app in 1 devices only while we expect it should be : devive 01 open the app to send , then device 02 open the app to verify receive.

Any solution for this stuck. Need help urgent. appricate your,guys reply.

Anyone has experience in this kind of testing. please help to share with me. appricate your reply.

move driver2 init into setup.

Hi to run in sequence Best way is to Testng.
Create a Suite and and set pareameters of two driver within Xml
and make method of @Before Test Synchronized to run in sequence