简体   繁体   中英

How to run test case on 2 devices with sequence in appium testing

Any one has experience in testing app chat. like : accountA send a message to accountB. So iam automating this flow by below steps :

1. open app in device 1 and send message to other account.

2. open app in device 2 and verify receiving message successfully.

I try to run in appium but the test case is only run in only 1 device. while we expect the 1st above step running on device 1. and the second step is running on device 2.

在此输入图像描述

and below is my code to open app in 2 devices.

在此输入图像描述

Anyone has idea about this stuck? or any solution for this automation type.

Use Appium Grid (Selenium Grid + 2 appium servers) and create two device drivers one for each.

Follow this link for appium grid

http://appium.readthedocs.io/en/stable/en/advanced-concepts/grid/

This can be done without Selenium Grid. The most important thing is to make sure that you provide different values for Selenium Port, Bootstrap Port and device UDIDs.

Your code is using deviceName as the property, which wouldn't work when you want to run scripts on multiple devices.

Check below link for detailed steps and the DesiredCapabilities code (the code at the end is for parallel execution, but you can change it for sequential execution as well)

http://www.automationtestinghub.com/appium-parallel-execution/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM