Невозможно найти элемент из-за ошибки JSON Proxy в Appium - PullRequest
0 голосов
/ 23 апреля 2019

Мы используем гибридное приложение (комбинация Native + Web) для тестирования, где нам нужно проверить элементы в приложении и выполнить необходимые действия, такие как нажатие на любую кнопку. У нас есть особый сценарий, когда в гибридном приложении мы запускаем видеоплеер и начинаем воспроизводить контент в нем. Когда контент воспроизводится, все элементы видны и кликабельны. В конкретном случае, когда в проигрывателе нажимается одна из кнопок, последние шаги для нажатия любой кнопки в DOM приводили к ошибке устаревшей ссылки.

**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
...