Unable to find the element due to JSON Proxy error in Appium


#1

We are using a hybrid application(combination of Native + Web) for testing where we need to check the elements in the application and do necessary actions like click on any buttons.
We have a particular scenario where in the hybrid application, we launch a video player and start playing a content in it. When the content is being played all the elements are visible and clickable.
At a particular instance where one of the button is clicked in the player, the latter steps to click any buttons in the DOM resulted in stale reference error.

Appium Versions Tried - 1.7.1 and 1.9.1

Appium Log
Matched ‘/wd/hub/session/eeb3760c-f645-4962-97a4-26a14d2e6769/element’ to command name ‘findElement’
[debug] [35m[JSONWP Proxy][39m Proxying [POST /wd/hub/session/eeb3760c-f645-4962-97a4-26a14d2e6769/element] to [POST http://127.0.0.1:8000/wd/hub/session/6bb2d7d41abe11bb21f8c216aa835ee9/element] with body: {“using”:“xpath”,“value”:“.//xxx.tab-bar//xxx.button.material[contains(@class,‘tab-bar-button home-button’)]“,”sessionId”:“eeb3760c-f645-4962-97a4-26a14d2e6769”}
[debug] [35m[JSONWP Proxy][39m Got response with status 200: {“sessionId”:“6bb2d7d41abe11bb21f8c216aa835ee9”,“status”:7,“value”:{“message”:“no such element: Unable to locate element: {\“method\“:\“xpath\“,\“selector\“:\“.//xx//xx[contains(@class,‘tab-bar-button home-button’)]\“}\n (Session info: chrome=73.0.3683.90)\n (Driver info: chromedriver=2.42.591059 (a3d9684d10d61aa0c45f6723b327283be1ebaad8),platform=Mac OS X 10.13.6 x86_64)“}}
[debug] [35m[MJSONWP][39m Encountered internal error running command: ProxyRequestError: Could not proxy command to remote server. Original error: The request to /wd/hub/session/eeb3760c-f645-4962-97a4-26a14d2e6769/element has failed
[debug] [35m[MJSONWP][39m at JWProxy.proxy$ (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:182:13)
[debug] [35m[MJSONWP][39m at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[debug] [35m[MJSONWP][39m at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[debug] [35m[MJSONWP][39m at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[debug] [35m[MJSONWP][39m at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[debug] [35m[MJSONWP][39m at
[debug] [35m[MJSONWP][39m Matched JSONWP error code 7 to NoSuchElementError
[35m[HTTP][39m [37m<-- POST /wd/hub/session/eeb3760c-f645-4962-97a4-26a14d2e6769/element [39m[31m500[39m [90m37 ms - 423[39m
[35m[HTTP][39m [90m[39m