Findelement takes long after switching to webview from native and eventually fails due to ESOCKETTIMEDOUT


#1

Hello,

I am automating an android hybrid application since the past year. Recently , i found that after I move from native context to the web context, the find element is taking too long and getting hanged

[W3C (f22d1a45)] Driver proxy active, passing request on via HTTP proxy

[debug] [WD Proxy] Matched ‘/wd/hub/session/f22d1a45-93b7-4156-b9a0-058cdebd465c/element’ to command name ‘findElement’

[debug] [WD Proxy] Proxying [POST /wd/hub/session/f22d1a45-93b7-4156-b9a0-058cdebd465c/element] to [POST http://127.0.0.1:8000/wd/hub/session/ec6618742d26711dd7db1d94393a51d4/element] with body: {“using”:“xpath”,“value”:"//div[@data-ui-state=‘skybetclub’]"}

[HTTP] <-- POST /wd/hub/session/f22d1a45-93b7-4156-b9a0-058cdebd465c/element - - ms - -

[HTTP]

[HTTP] --> POST /wd/hub/session/f22d1a45-93b7-4156-b9a0-058cdebd465c/element

[HTTP] {“using”:“xpath”,“value”:"//div[@data-ui-state=‘thisclub’]"}

[W3C (f22d1a45)] Driver proxy active, passing request on via HTTP proxy

[WD Proxy] Got an unexpected response: {“code”:“ESOCKETTIMEDOUT”,“connect”:false}

[debug] [WD Proxy] Matched ‘/wd/hub/session/f22d1a45-93b7-4156-b9a0-058cdebd465c/element’ to command name ‘findElement’

[debug] [WD Proxy] Proxying [POST /wd/hub/session/f22d1a45-93b7-4156-b9a0-058cdebd465c/element] to [POST http://127.0.0.1:8000/wd/hub/session/ec6618742d26711dd7db1d94393a51d4/element] with body: {“using”:“xpath”,“value”:"//div[@data-ui-state=‘thisclub’]"}

Code when this happens :
if((driver.findElement(By.xpath("//div[@data-ui-state=‘thisclub’]").isDisplayed())){
return true;
}

this waits for so long that eventually times out as below

[debug] [W3C (f22d1a45)] Encountered internal error running command: Error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: Error: ESOCKETTIMEDOUT

[debug] [W3C (f22d1a45)] at doJwpProxy (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:547:13)

[debug] [W3C (f22d1a45)] at <anonymous>

[debug] [W3C (f22d1a45)] at process._tickCallback (internal/process/next_tick.js:188:7)

Version of appium : v1.13.0-beta.1
chromedriver : ‘73.0.3683.68’

Please Help