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 '18 at 4:12

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 '16 at 16:55
  • Webview to Native man,Simple Sep 19 '16 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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