Two Apps in a Single Script

I haven’t tried this with android but you should be able to create two instances of AndroidDriver. So the code would be something like:

File app1 = new File(appDir, "skype.apk");
DesiredCapabilities capabilities1 = new DesiredCapabilities();
capabilities.setCapability("app", app1.getAbsolutePath());
// set other capabilities here
driver1 = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities1);

File app2 = new File(appDir, "recorder.apk");
DesiredCapabilities capabilities2 = new DesiredCapabilities();
capabilities2.setCapability("app", app2.getAbsolutePath());
// set other capabilities here
driver2 = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities2);

Now you can use driver1 to control the skype and driver2 to control the recorder (you’ll have to give real APKs for the apps; I just put fake ones).

Darrell

1 Like