Switching context to webview

My app has a webview.
when I do getContexts I get [“NATIVE_APP”, “WEBVIEW_chrome”] . When I am trying to switch to webview I get error

[EspressoDriver@2360 (dc403a2f)] Got response with status 500: {"id":"eed1ca51-18e1-46ae-8149-f63b4286bf9e","sessionId":"5abc60ec-57e2-4ed0-ade8-fc757ae993b8","value":{"error":"unknown error","message":"androidx.test.espresso.NoActivityResumedException: No activities in stage RESUMED. Did you forget to launch the activity. (test.getActivity() or similar)?","stacktrace":"androidx.test.espresso.NoActivityResumedException: No activities in stage RESUMED. Did you forget to launch the activity. (test.getActivity() or similar)?\n\tat dalvik.system.VMStack.getThreadStackTrace(Native Method)\n\tat java.lang.Thread.getStackTrace(Thread.java:1736)\n\tat androidx.test.espresso.base.EspressoExceptionHandler.handleSafely(EspressoExceptionHandler.java:2)\n\tat androidx.test.espresso.base.EspressoExceptionHandler.handleSafely(EspressoExceptionHandler.java:1)\n\tat androidx.test.espresso.base.DefaultFailureHandler$TypedFailureHandler.handle(DefaultFailureHandler.java:4)\n\tat io.appium.espressoserver.lib.helpers.CustomFailureHandler.handle(CustomFailureHandler.kt:49)\n\tat androidx.t...[debug] [W3C] Matched W3C error code 'unknown error' to UnknownError