Switching to Webview context fails

I was automating an hybrid app, while switching, it only shows name native context. WebView Context is shown as webview_undefined.

Set<String>  contextNames = driver.getContextHandles(); for (String contextName : contextNames)  {      System.out.println(contextName);      if (contextName .contains("WEBVIEW"))      {          driver.context(contextName);          webViewFound = true;          System.out.println("switched to webview");     } } 

I'm using the above code. Can anyone give solution for this !


Dinesh, Give a try to below snippet

Set <String> handles =driver.getWindowHandles();
Iterator<String> it = handles.iterator();

String parent = it.next();
String child = it.next();

//perform actions on child window

driver.close(); // only for child wondow

//perform actions on parent window

driver.quit(); // After execution of main thread and for parent window

Category: selenium Time: 2016-07-30 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.192 (s). 12 q(s)