Skip to main content
deleted 74 characters in body
Source Link
alecxe
  • 11.4k
  • 11
  • 51
  • 107

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_"))
                       {
                           ad.context(lastestContextView);
                           System.out.println("Latest Context Name"+lastestContextView);
                       }                    
                    Thread.sleep(5000);
                    ad.context("NATIVE_APP");

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_"))
                       {
                           ad.context(lastestContextView);
                           System.out.println("Latest Context Name"+lastestContextView);
                       }                    
                    Thread.sleep(5000);
                    ad.context("NATIVE_APP");

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_"))
{
    ad.context(lastestContextView);
    System.out.println("Latest Context Name"+lastestContextView);
}                   
Thread.sleep(5000);
ad.context("NATIVE_APP");
Source Link

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_"))
                       {
                           ad.context(lastestContextView);
                           System.out.println("Latest Context Name"+lastestContextView);
                       }                    
                    Thread.sleep(5000);
                    ad.context("NATIVE_APP");