How to change context in Appium?
//Getting all the context.
Set pContext = driver.getContextHandles();
//Setting it to array to change it.
driver.context(pContext.toArray()[1]);
//Changing it to Native App Context.
driver.context("NATIVE_APP");
Posted on May 9, 2019
By Shah Nawaz
//Getting all the context.
Set pContext = driver.getContextHandles();
//Setting it to array to change it.
driver.context(pContext.toArray()[1]);
//Changing it to Native App Context.
driver.context("NATIVE_APP");
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it. Privacy Policy
Accept
Copyright All Rights Reserved © 2025