Thanks for your reply. Now i could switch over to WEBVIEW by setting 'automationName = selendroid' .But issue, i am getting error when i use @driver.find_element(:class_name,'x-button-back').click
See the below logs.
info: [debug] Getting a list of available webviews
info: [debug] executing cmd: /Applications/AndroidSdk/sdk/platform-tools/adb -s ZX1D63H5LP shell "cat /proc/net/unix"
info: [debug] WEBVIEW_2725 mapped to pid 2725
info: [debug] Getting process name for webview
info: [debug] executing cmd: /Applications/AndroidSdk/sdk/platform-tools/adb -s ZX1D63H5LP shell "ps"
info: [debug] Parsed pid: 2725 pkg: com.example.sample
info: [debug] from: u0_a311,2725,326,1146180,68380,ffffffff,00000000,S,com.example.sample
info: [debug] returning process name: com.example.sample
info: [debug] Available contexts: undefined
info: [debug] ["WEBVIEW_com.example.sample"]
info: [debug] Making http request with opts: {"url":"http://localhost:8080/wd/hub/session/8c220843-f667-f11e-f570-88f32b5ff8f2/window_handles","method":"GET"}
info: [debug] Available contexts: ["WEBVIEW_0","NATIVE_APP"]
info: [debug] Responding to client with success: {"status":0,"value":["WEBVIEW_0","NATIVE_APP"],"sessionId":"8c220843-f667-f11e-f570-88f32b5ff8f2"}
info: <-- GET /wd/hub/session/8c220843-f667-f11e-f570-88f32b5ff8f2/contexts 200 136.910 ms - 98 {"status":0,"value":["WEBVIEW_0","NATIVE_APP"],"sessionId":"8c220843-f667-f11e-f570-88f32b5ff8f2"}
info: --> POST /wd/hub/session/8c220843-f667-f11e-f570-88f32b5ff8f2/context {"name":"WEBVIEW_0"}
info: [debug] Getting a list of available webviews
info: [debug] executing cmd: /Applications/AndroidSdk/sdk/platform-tools/adb -s ZX1D63H5LP shell "cat /proc/net/unix"
info: [debug] WEBVIEW_2725 mapped to pid 2725
info: [debug] Getting process name for webview
info: [debug] executing cmd: /Applications/AndroidSdk/sdk/platform-tools/adb -s ZX1D63H5LP shell "ps"
info: [debug] Parsed pid: 2725 pkg: com.example.sample
info: [debug] from: u0_a311,2725,326,1144376,66440,ffffffff,00000000,S,com.example.sample
info: [debug] returning process name: com.example.sample
info: [debug] Available contexts: WEBVIEW_0,NATIVE_APP
info: [debug] ["WEBVIEW_com.example.sample"]
info: [debug] Making http request with opts: {"url":"http://localhost:8080/wd/hub/session/8c220843-f667-f11e-f570-88f32b5ff8f2/window_handles","method":"GET"}
info: [debug] Available contexts: ["WEBVIEW_0","NATIVE_APP"]
info: [debug] Making http request with opts: {"url":"http://localhost:8080/wd/hub/session/8c220843-f667-f11e-f570-88f32b5ff8f2/context","method":"POST","json":{"name":"WEBVIEW_0"}}
info: [debug] Responding to client with success: {"status":0,"value":null,"sessionId":"8c220843-f667-f11e-f570-88f32b5ff8f2"}
info: <-- POST /wd/hub/session/8c220843-f667-f11e-f570-88f32b5ff8f2/context 200 206.674 ms - 76 {"status":0,"value":null,"sessionId":"8c220843-f667-f11e-f570-88f32b5ff8f2"}
info: --> POST /wd/hub/session/8c220843-f667-f11e-f570-88f32b5ff8f2/element {"using":"class name","value":"x-button-back"}
info: [debug] Proxying command to localhost:8080
info: [debug] Making http request with opts: {"url":"http://localhost:8080/wd/hub/session/8c220843-f667-f11e-f570-88f32b5ff8f2/element","method":"POST","json":{"using":"class name","value":"x-button-back"}}
info: [debug] [SELENDROID] -1
info: [debug] [SELENDROID] -1
info: [debug] Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command.","origValue":"Did not successfully proxy server command"},"sessionId":"8c220843-f667-f11e-f570-88f32b5ff8f2"}
info: <-- POST /wd/hub/session/8c220843-f667-f11e-f570-88f32b5ff8f2/element 500 212.396 ms - 210
info: --> DELETE /wd/hub/session/8c220843-f667-f11e-f570-88f32b5ff8f2 {}
info: Shutting down appium session
info: [debug] Stopping selendroid server
info: [debug] Making http request with opts: {"url":"http://localhost:8080/wd/hub/session/8c220843-f667-f11e-f570-88f32b5ff8f2","method":"DELETE"}
info: [debug] Cleaning up appium session
info: [debug] Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command. (Original error: socket hang up)","code":"ECONNRESET","origValue":"socket hang up"},"sessionId":null}
info: <-- DELETE /wd/hub/session/8c220843-f667-f11e-f570-88f32b5ff8f2 500 5.685 ms - 202