How to switch to WEBVIEW using SafariLuancher app in C#?


I am trying to open a sample url "( on Iphone. I am using c#. Can someone help with the code snippet to switch context to WEBVIEW in C#?

Here is working Java code. I need it in C#?

Set contextNames =driver.getContextHandles();
for (String contextName : contextNames) {

if (contextName.contains(“WEBVIEW”)){


var contextName = driver.Contexts[1].ToString();
//may be other index, debug and check, it start with WEB_VIEW. If you only have 1 context that mean your apk is not enable webview debug. ask dev team to do
Console.WriteLine(“context:” + contextName);
driver.Context = contextName;