0

While testing Hybrid android app in Appium, a change of context from NATIVE to WEBVIEW is expected. But, the name of the WEBVIEW context does not remain same at all instance of testing. However, it is one of the follwing:

WEBVIEW_undefined

WEBVIEW_{package_name_of_application_under_test}

Say, I'm testing a Hybrid app with package name

com.webviewbrowser

In this case, the context name of the WEBVIEW switches randomly between the following two at every instance

WEBVIEW_undefined

WEBVIEW_com.webviewbrowser

When I use the following in my code,

driver.context("WEBVIEW_com.webviewbrowser")

Miserably, I actually receive the context name WEBVIEW_undefined sometimes and NosuchContextException is thrown.

Why does this happen even when no other app is running at the time of testing?

How do I get rid of this issue?

1 Answer 1

0

try adding : capabilities.SetCapability("autoWebview", "true");

or

When you are switching between 2 web views try to switch like this:

ReadOnlyCollection<string> windowHandles = InitialiseAppium.driver.WindowHandles;
InitialiseAppium.driver.SwitchTo().Window(windowHandles[1]);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.