问题已经解决 感谢大家 ,版本不兼容的原因导致 降级了 appium-python-cleint 的 版本即可
楼主请教下 这个怎么解决?
C:\Users\CNHUZHU6\Desktop\资料\Daas\接口\Daas\venv\Scripts\python.exe C:/Users/CNHUZHU6/Desktop/资料/Daas/Daas 自动化/Daas_Auto_Test/PC_client_demo.py
Traceback (most recent call last):
File "C:/Users/CNHUZHU6/Desktop/资料/Daas/Daas 自动化/Daas_Auto_Test/PC_client_demo.py", line 23, in open_PCclient
self.driver = webdriver.Remote('http://{}:{}'.format(host, port), desired_caps)
File "C:\Users\CNHUZHU6\AppData\Local\Programs\Python\Python36\lib\site-packages\appium\webdriver\webdriver.py", line 268, in init
AppiumConnection(command_executor, keep_alive=keep_alive), desired_capabilities, browser_profile, proxy
File "C:\Users\CNHUZHU6\Desktop\资料\Daas\接口\Daas\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init
self.start_session(capabilities, browser_profile)
File "C:\Users\CNHUZHU6\AppData\Local\Programs\Python\Python36\lib\site-packages\appium\webdriver\webdriver.py", line 357, in start_session
response = self.execute(RemoteCommand.NEW_SESSION, parameters)
File "C:\Users\CNHUZHU6\Desktop\资料\Daas\接口\Daas\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\CNHUZHU6\Desktop\资料\Daas\接口\Daas\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/CNHUZHU6/Desktop/资料/Daas/Daas 自动化/Daas_Auto_Test/PC_client_demo.py", line 36, in
win.open_PCclient()
File "C:/Users/CNHUZHU6/Desktop/资料/Daas/Daas 自动化/Daas_Auto_Test/PC_client_demo.py", line 25, in open_PCclient
raise AssertionError(e)
AssertionError: Message: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
Process finished with exit code 1
感谢 飞哥分享:
不会抛异常 没有返回 然后试了下 用 find_element_by_id(“”).click() 的 方法 还是报同样的错 , 最后测试跳过这个元素,操作点击其他的元素的时候同样也会报这个错误 ,请大佬帮忙排查下 万分感谢
但是我 try 了一下 应该是找到了这个元素
加上.click()就会报这个错误