I am using Appium 1.2.3 in Selendroid mode. Before I switch to a new context, I make sure that it’s already available by invoking:
driver.getContextHandles();
and then I switch to the new context. The problem is that sometimes Appium fails to find any contexts at all and it returns Undefined as the available context handles. The only solution to get around this is to kill the Appium server, uninstall the app from the phone and try to start a new session.
Have anyone faced such issues??