Problem re-switching to webview

I am having problem with webview(context) when I try to switch to webview(context) in following sequence
1 switch to webview(context).
2 switches to native_app view(context).
3 again switch to webview(context) - now Appium get hangs up.
I am facing problem on Android SDK version 5.0.2.
Can you guide me a way to solve this issue out?

1 Like

I think I fixed this recently, can you update to the latest version of appium? Or perhaps build from master?

The same problem exists in 1.4.1 and even new problem of session getting expire starts after running few testcases.

Even I started facing this issue on 1.4.1 …
Earlier on 1.3.5 it was working fine for me.

Raised an issue @ https://github.com/appium/appium/issues/5230

Thanks,
Ramdas

Hi,

I am also facing same issue –
While switching to WebView getting below log in Appium

info: [debug] from: u0_a258,6245,150,707180,86156,ffffffff,00000000,R,com.veloziti.salesforce
info: [debug] returning process name: com.veloziti.salesforce
info: [debug] Available contexts:
info: [debug] [“WEBVIEW_com.veloziti.salesforce”]
info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.veloziti.salesforce
info: [debug] Responding to client with success: {“status”:0,“value”:[“NATIVE_APP”,“WEBVIEW_com.veloziti.salesforce”],“sessionId”:“50918f8c-f0be-4007-a64e-e0c2ba5c6783”}

info: <-- GET /wd/hub/session/50918f8c-f0be-4007-a64e-e0c2ba5c6783/contexts 200 171.415 ms - 120 {“status”:0,“value”:[“NATIVE_APP”,“WEBVIEW_com.veloziti.salesforce”],“sessionId”:“50918f8c-f0be-4007-a64e-e0c2ba5c6783”}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.1”,“revision”:“ce6220829063679bcccf5724515c29569c4a16d9”}},“sessionId”:“50918f8c-f0be-4007-a64e-e0c2ba5c6783”}
info: <-- GET /wd/hub/status 200 1.979 ms - 155 {“status”:0,“value”:{“build”:{“version”:“1.4.1”,“revision”:“ce6220829063679bcccf5724515c29569c4a16d9”}},“sessionId”:“50918f8c-f0be-4007-a64e-e0c2ba5c6783”}

info: --> POST /wd/hub/session/50918f8c-f0be-4007-a64e-e0c2ba5c6783/context {“name”:“WEBVIEW_com.veloziti.salesforce”}

info: [debug] Getting a list of available webviews
info: [debug] executing cmd: /Applications/ADT/sdk/platform-tools/adb -s P7BILB7P9LIFSWMB shell “cat /proc/net/unix”

info: [debug] WEBVIEW_6245 mapped to pid 6245
info: [debug] Getting process name for webview
info: [debug] executing cmd: /Applications/ADT/sdk/platform-tools/adb -s P7BILB7P9LIFSWMB shell “ps”

info: [debug] Parsed pid: 6245 pkg: com.veloziti.salesforce

info: [debug] from: u0_a258,6245,150,707180,87672,ffffffff,00000000,R,com.veloziti.salesforce
info: [debug] returning process name: com.veloziti.salesforce
info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.veloziti.salesforce
info: [debug] [“WEBVIEW_com.veloziti.salesforce”]
info: [debug] Available contexts: NATIVE_APP,WEBVIEW_com.veloziti.salesforce
info: [debug] Connecting to chrome-backed webview

info: Set chromedriver binary as: /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver
info: Killing any old chromedrivers, running: ps -ef | grep /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver | grep -v grep |grep -e ‘–port=9515(\s.*)?$’ | awk ‘{ print $2 }’ | xargs kill -15

info: Successfully cleaned up old chromedrivers

info: Spawning chromedriver with: /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver --url-base=wd/hub --port=9515

info: [CHROMEDRIVER STDOUT] Starting ChromeDriver 2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb61df8f) on port 9515
Only local connections are allowed.

info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body

info: Proxying [GET /status] to [GET http://127.0.0.1:9515/wd/hub/status] with no body

info: Got response with status 200: {“sessionId”:"",“status”:0,“value”:{“build”:{“version”:“alpha”},“os”:{“arch”:“x86_64”,“name”:“Mac OS X”,“version”:“10.10.1”}}}
info: Proxying [POST /session] to [POST http://127.0.0.1:9515/wd/hub/session] with body: {“desiredCapabilities”:{“chromeOptions”:{“androidPackage”:“com.veloziti.salesforce”,“androidUseRunningApp”:true,“androidDeviceSerial”:“P7BILB7P9LIFSWMB”}}}

info: Got response with status 200: {“sessionId”:“feaea0e8ec4c82ca26138b80298fcc6c”,“status”:0,“value”:{“acceptSslCerts”:true,“applicationCacheEnabled”:false,“browserConnectionEnabled”:false,“browserName”:“chrome”,“chrome”:{},"cssSelect…

info: [debug] Responding to client with success: {“status”:0,“value”:null,“sessionId”:“50918f8c-f0be-4007-a64e-e0c2ba5c6783”}
info: <-- POST /wd/hub/session/50918f8c-f0be-4007-a64e-e0c2ba5c6783/context 200 2252.138 ms - 76 {“status”:0,“value”:null,“sessionId”:“50918f8c-f0be-4007-a64e-e0c2ba5c6783”}

info: --> POST /wd/hub/session/50918f8c-f0be-4007-a64e-e0c2ba5c6783/element {“using”:“xpath”,“value”:"//button[@id=‘menuButton’]"}

info: Proxying [POST /wd/hub/session/50918f8c-f0be-4007-a64e-e0c2ba5c6783/element] to [POST http://127.0.0.1:9515/wd/hub/session/feaea0e8ec4c82ca26138b80298fcc6c/element] with body: {“using”:“xpath”,“value”:"//button[@id=‘menuButton’]"}

info: Got response with status 200: {“sessionId”:“feaea0e8ec4c82ca26138b80298fcc6c”,“status”:7,“value”:{“message”:"no such element\n (Session info: webview=)\n (Driver info: chromedriver=2.15.322455 (ae8db840dac8d0c453355d3d922c91adfb…

info: <-- POST /wd/hub/session/50918f8c-f0be-4007-a64e-e0c2ba5c6783/element 200 255.302 ms - 244

info: --> GET /wd/hub/status {}

error: Got bad session base with rest of url: /status

info: <-- GET /wd/hub/status - - ms - -

info: --> GET /wd/hub/status {}

error: Got bad session base with rest of url: /status

info: <-- GET /wd/hub/status - - ms - -

info: --> GET /wd/hub/status {}

error: Got bad session base with rest of url: /status

info: <-- GET /wd/hub/status - - ms - -

undefined

info: --> GET /wd/hub/status {}

error: Got bad session base with rest of url: /status

@Jimit24365 please clarify which appium capabilities did you use for launching both appium and webview ?