Hi everybody.
I’m using Appium 1.3.5 to automate an Android App.
I have an app that needs to interact with a webview, so I need to switch between NATIVE and WEBVIEW contexts.
The first time I switch to the WEBVIEW context all works fine, but when I switch back to NATIVE context and then switch again to WEBVIEW context, chromedriver doesn’t respond.
In the appium log, I can see:
Connecting to chrome-backed webview
Found existing Chromedriver for context 'WEBVIEW_com.example.myapp'. Using it.
Making http request with opts: {"url":"http://127.0.0.1:9515/wd/hub/session/0c2dd761a18915ae0c9a46222eb98b4c/url","method":"GET"}
And then it stops, waiting for chromedriver to respond
I’ve seen in the Appium’s source code that Appium is caching the chromedriver session id created for the first webview context switching, and reusing it every time you want to switch to webview context.
if (this.sessionChromedrivers[context]) {
logger.debug("Found existing Chromedriver for context '" + context + "'." +
" Using it.");
...
If few time spent between both context switching it works OK, so I think the problem might be that the chromedriver session expires and Appium is still trying to use the old session id. But there os no error response from chromedriver, Appium simply keeps waiting indefinitely without timeout (just guessing)
Does someone know how to workaround this?
Is there a way to tell Appium not to reuse chromedriver sessions?
Is there a way to change the chromedriver session timeout?
Thank you!