Appium 要获取 webview 页面 handle 报错:Original error: 404 - "unknown command: session/f9dc30098067a7aa5fc5c34eda847e42/window/handles

Tina · August 21, 2018 · Last by Tina replied at August 23, 2018 · Last modified by admin 恒温 · 1493 hits

Traceback (most recent call last):
File "Test001_RefuseSaleManagerRegister.py", line 27, in testRefuseRegisterApplication
print(self.appium_driver.window_handles)
File "D:\software\python\3.6.6\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 723, in window_handles
return self.execute(Command.W3C_GET_WINDOW_HANDLES)['value']
File "D:\software\python\3.6.6\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute
self.error_handler.check_response(response)
File "D:\software\python\3.6.6\lib\site-packages\appium\webdriver\errorhandler.py", line 29, in check_response
raise wde
File "D:\software\python\3.6.6\lib\site-packages\appium\webdriver\errorhandler.py", line 24, in check_response
super(MobileErrorHandler, self).check_response(response)
File "D:\software\python\3.6.6\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: 404 - "unknown command: session/f9dc30098067a7aa5fc5c34eda847e42/window/handles"

appium server:1.8.1
python:3.6.6

之前没有问题,是Python3.6.4,不知道版本有影响没

共收到 3 条回复 时间 点赞

webview有handles这个概念吗,不都是直接获取context,然后switch进去呀

Tina #2 · August 23, 2018 作者
雨夜狂奔 回复

是的,有的webview页面有多个handle,需要切换后才能定位到

Tina #3 · August 23, 2018 作者

已经确认了是0.28版本的Bug,我用了以前的版本可以的

恒温 关闭了讨论 23 Aug 13:37
需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up