I just started working on appium with python, i want to run same script on two android devices at a same time on same machine. For example: I want to Call from device 1 and accepting the call on device 2.
My question is: How to start 2 appium clients and configure it to 2 different android devices. I have gone through few posts previously posted but not able to figure it out. pls help.
i ran above command hoping appium will open with the given port number(4725) but appium is launched with default port(4723). do i have to change port manually whenappium is launched from settings option.
@willosser no. i do it in driver. example of driver capabilities:
Capabilities [{app=/Users/Aleksei/Downloads/test_clients/xxxx.apk, noReset=false, clearSystemFiles=true, appWaitActivity=xxxxx, disableAndroidWatchers=true, version=, deviceName=LGH8155e9892e6, fullReset=true, platform=ANDROID, automationName=Appium, browserName=, autoGrantPermissions=true, waitForAppScript=$.delay(100); true;, udid=LGH8155e9892e6, platformName=Android}]
@DataProvider(parallel=true)
public Object[][] portDriver()
{
//Rows - Number of times your test has to be repeated.
//Columns - Number of parameters in test data.
Object[][] data = new Object[2][1];
// 1st row
data[0][0] ="5d6ef2bd";
// 2nd row
data[1][0] ="d859dc2d";
return data;
}
public static String firstDeviceName="5d6ef2bd";
public static String SecondDeviceName="d859dc2d";
@Factory(dataProvider="portDriver")
@BeforeClass
public void Init(String device_id) throws IOException, InterruptedException{
DesiredCapabilities capabilities = new DesiredCapabilities();
if(device_id.equalsIgnoreCase(firstDeviceName)){
capabilities.setCapability("deviceName",firstDeviceName);
capabilities.setCapability("udid", firstDeviceName);
capabilities.setCapability(MobileCapabilityType.APP,"/Users/shanthalakshmi/Documents/BushfireFinal/BushFire1/Resources/app/BushFire 1.0.0.4.apk");
//setDeviceID=device_id;
driver1=new AndroidDriver(new URL("http://127.0.0.1:4733/wd/hub"), capabilities);
driver1.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);
}else if(device_id.equalsIgnoreCase(SecondDeviceName)){
capabilities.setCapability("deviceName",SecondDeviceName);
capabilities.setCapability("udid", SecondDeviceName);
capabilities.setCapability(MobileCapabilityType.APP,"/Users/shanthalakshmi/Documents/BushfireFinal/BushFire1/Resources/app/BushFire 1.0.0.4.apk");
driver2=new AndroidDriver(new URL("http://127.0.0.1:4743/wd/hub"), capabilities);
driver2.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);
}
}
only one session is getting invoked…Please help me
@slakshmiics@nagesh Were you able to run appium automation on 2 different instances? Do you require more than 1 driver for starting multiple instances?