我们正在使用混合应用程序(本机+ 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