Hi Nivi;
I am creating the 2 IOS drivers on a single thread. As mentioned above, one driver is for the ios emulator, the other for a physical device (I assume this configuration is okay). If I run them separately all works fine, but together there is an issue. It is clear that there is some form of conflict but since each driver is targeting a different device, I am not sure where the conflict might be ? Would there be something in the Appium Studio logs that would be helpful ?
Below I show the code snippets that create the two devices. The CreateDevice class is called twice to create the 2 driver objects.
try {
device0 = SelectDeviceEnum.DEV_0.setDeviceType(DeviceTypeOptionsEnum.IOS_PHYSICAL);
device1 =SelectDeviceEnum.DEV_1.setDeviceType(DeviceTypeOptionsEnum.IOS_SIMULATOR);
try( CreateDevice dev0 = new CreateDevice(device0)){
CreateDevice dev1 = new CreateDevice(device1);
:
:
}
Within CreateDevice():
private void buildIosPhysicalDriver(String iosBundleID) throws MalformedURLException {
DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability(MobileCapabilityType.UDID, “de26b951ae4075f8ee712fa73b22f65ba182c2d7”);
dc.setCapability(IOSMobileCapabilityType.BUNDLE_ID, iosBundleID);
dc.setCapability(IOSMobileCapabilityType.LAUNCH_TIMEOUT, 30000); //30 seconds
dc.setCapability(“instrumentApp”, true);
IOSDriver iosDriver = new IOSDriver(new URL(appiumServerURL), dc);
setDriver(iosDriver);
private void buildIosSimulatorDriver(String iosBundleID) throws MalformedURLException {
DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability(SeeTestCapabilityType.DEVICE_QUERY, “@os=‘ios’ and @emulator=‘true’”);
dc.setCapability(SeeTestCapabilityType.INSTRUMENT_APP, true);
dc.setCapability(IOSMobileCapabilityType.BUNDLE_ID, iosBundleID);
IOSDriver iosDriver = new IOSDriver(new URL(appiumServerURL), dc);
setDriver(iosDriver);
}
Look forward to your feedback !
If there is sample code that demonstrates how to create 2 drivers that operate concurrently, I’d like to see it.
thanks
walter