How to switch from a Native to WebView?When i use the below code:
String context=ElementsAction.driver.getContext();
System.out.println("Context Name" +context);
//Here my Context is getting printed as NativeAPP
Set<String> contextNames = ElementsAction.driver.getContextHandles();
for (String contextName : contextNames) {
System.out.println(contextName); //prints out something like NATIVE_APP \n WEBVIEW_1
}
In the above code snippet,line 2 the Context gets printed as NativeAPP but i am trying to get the WEBAPP view,but that line 4 fails and throws below error message.
"An unknown server-side error occurred while processing the command. (Original error: connect ECONNREFUSED) (WARNING: The server did not provide any stacktrace information)"
Kindly help i am totally stuck.
Thanks
created
Apr '15last reply
Sep '15- 12
replies
- 3.5k
views
- 4
users
- 6
likes
- 3
links