I am writing a cross platform automation where I have a selenium desktop driver and I perform some action which launches my service on device and an alert is launched on android device and i want to accept the alert and then use both web driver and mobile driver together to perform some functionality.
The web driver is working fine it performs the desired action on web browser and creates an alert on device side.
Hence my application/service is already launched on the device and now when i try to set the appium capabilities:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platform", "ANDROID");
capabilities.setCapability("version", "4.4");
capabilities.setCapability("automationName", "uiautomator2");
capabilities.setCapability("deviceName", "karnak");
capabilities.setCapability("platformVersion", "7.1");
capabilities.setCapability("noReset", "true");
capabilities.setCapability("autoGrantPermissions", "true");
capabilities.setCapability("appPackage", "xyz");
capabilities.setCapability("appActivity", ".abc");
capabilities.setCapability("optionalIntentArguments", payload);
What happens is appium will kill the existing session that i have and will install the application and try to start the activity with the provided payload which won't be valid now.
So there a way where i can create a mobile driver for existing running application/service on the device without have to install the application and re-launching it.
I found that you have to do noReset but that doesn't seem to work for me. I tried providing appWaitPackage and appWaitActivity instead of appPackage and appActivity and that didn't work either.
Let me know if any of you know how i can attach the mobile driver to existing running application/service.