Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Switch from one application to another application at runtime in Appium

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 2.43k
    Comment on it

    There are many times we have to switch from one application to another while in the middle of execution. In this case we have to switch to the second application and then perform some action and then again return back to the previous application.

    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
    capabilities.setCapability("device", "Android");
    capabilities.setCapability("deviceName", "Galaxy Note3");
    capabilities.setCapability("platformVersion", "5.0");
    driver = new AndroidDriver(new URL(""), capabilities);
    driver.manage().timeouts().implicitlyWait(20L, TimeUnit.SECONDS);
    //launch settings Application
    driver.startActivity(settingsAppPackageName, settingsAppActivityName);
    //Switch ON Bluetooth
    //Re launch Caller Application
    driver.startActivity(callerAppPackageName, callerAppActivityName);

    Suppose we are on the mobile calling and we want to switch on Bluetooth then first the caller screen will be launched, then we will launch the settings screen and switch on the Bluetooth. Now again move back to the previous activity.

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: