I have a problem while switching from native view to webview in Android while testing on MAC OS. But the same scripts works fine in windows. In Mac it gives chrome not reachable as a webdriver exception or some times session not found exception. I'm using Appium with Eclipse in Mac. I tried replacing different version of chromedriver but none of them worked. Any solution for this!


  • please post the error Aug 24, 2018 at 4:12

1 Answer 1


I am using same environment as you described and working fine. Dinesh give a try:

Set<String> contextNames = ad.getContextHandles();      
System.out.println("Context Names:"+contextNames.toString());

String lastestContextView = (String) contextNames.toArray()[contextNames.size()-1];

if (lastestContextView.contains("WEBVIEW_"))
    System.out.println("Latest Context Name"+lastestContextView);
  • where should I use this? For native switch or webview ? Sep 19, 2016 at 16:55
  • Webview to Native man,Simple Sep 19, 2016 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.