Test HYBRID app with appium via visual studio with C#

I’m testing Hybrid app using: Appium and C# by visual studio.
I know that I need to change the context in order to use the WEBVIEW.

This is the available context I have:
info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.

This is my C# code:
public void TestMethod1()
DesiredCapabilities cap = new DesiredCapabilities();
cap.SetCapability(“platformName”, “Android”);
cap.SetCapability(“platformVersion”, “6.0”);
cap.SetCapability(“deviceName”, “test”);
cap.SetCapability(“appPackage”, );
cap.SetCapability(“appActivity”, );

        driver = new AndroidDriver<AndroidElement>(new Uri(""), cap);

        driver.Context = "WEBVIEW_com.<MYAPPPNAME>";

While debuging I can see this error below when trying to set the driver.context:
An exception of type ‘OpenQA.Selenium.WebDriverException’ occurred in appium-dotnet-driver.dll but was not handled in user code

Additional information: The HTTP request to the remote WebDriver server for URL timed out after 60 seconds.

What I’m missing here?


Checkout http://appium.readthedocs.io/en/stable/en/writing-running-appium/appium-bindings/.

It is a great reference for your language specific syntax.

I believe that code you need would be something like:

I don’t believe you need to provide the .MYAPPNAME that you have in your original code, but as my appium tests are written in Ruby, I’m not 100% sure.

Also, make sure that your webview is fully loaded before attempting to interact with your login field.

Good luck and hope that helps!