javaandroidseleniumappiumselendroid

How to automate two android app simultaneously using Appium?


I have to launch two app in two different devices and after completing action from one app, I have to check it from another app.


Solution

  • Up and Run two appium servers instance along with writing two different capabilities sets in your appium script as mentioned below:

    1) You need 2 appium running with each different ports

    baseUrl_1 = "http://0.0.0.0:**4726**/wd/hub"
    
    baseUrl_2 = "http:/0.0.0.0:**4725**/wd/hub"
    

    2) You need to have 2 different instances of android emulator.So make sure you just run different emulators (what i mean it can be the same version everything but the 2nd one change the name). Apparently appium was getting confuse if i run it with the same.

    3) You need to set the capabilities for each emulator:

    caps1 = {
    platformName:"ANDROID",
    platformVersion: "4.4",
    deviceName: "emulator-5554",
    app: "app1Path.apk",
           browserName: "",
    

    }

    caps2 = {
     platformName:"ANDROID",
     platformVersion: "4.4",
     deviceName: "emulator-5556",
     app: "app2Path.apk",
     browserName: ""
    

    }