Hi,
I am trying to use Appium and need to open Chrome and a Native app on Android. I would like to do so using 1 driver instance.
Scenario:
- Start the chrome activity, go on a particular website, retrieve a token
- Start the activity by passing the token retrieved in 1)
Here is a sample of my code
DesiredCapabilities clientCapabilities = new DesiredCapabilities();
clientCapabilities.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, appPackage);
clientCapabilities.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, activity);
clientCapabilities.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS, true);
clientCapabilities.setCapability(MobileCapabilityType.DEVICE_NAME, deviceConfiguration.getDeviceName());
clientCapabilities.setCapability(MobileCapabilityType.UDID, deviceConfiguration.getUDID());
clientCapabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, deviceConfiguration.getPlatformVersion());
clientCapabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
clientCapabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 10000);
Activity activity = new Activity("com.android.chrome","com.google.android.apps.chrome.Main");
driver.startActivity(activity);
driver.get("https://mywebsite.com"); <-------- it doesn't work, I am not redirected to that website !
I have also tried to add clientCapabilities.setCapability(MobileCapabilityType.BROWSER_NAME, “Chrome”) when setting up the capabilities, however if I do that the driver is not able to find any element in the native app when I start the activity for the native app.
What am I missing?