python+appium自动化测试遇到的一些坑及问题总结(三)

时间:2024-03-29 09:17:02

Issue 21: 手机模拟滑动屏幕, 使用driver.get_window_size()会报错,提示selenium.common.exceptions.WebDriverException: Message: The URL ‘/wd/hub/session/2763af95-8c0c-4533-8b73-0eae25e5a026/window/size’ did not map to a valid resource

Solution:
源码路径:python-path\Lib\site-packages\selenium\webdriver\remote\remote_connection.py (353行)

修改selenium源码变更get_window_size的请求路径为:
Command.W3C_GET_WINDOW_SIZE: (‘GET’, ‘/session/sessionId/window/sessionId/window/windowHandle/size’),

参考:https://testerhome.com/topics/16435

Issue 22: 如何查看appium库的文档:

python -m pydoc -p 4567

Issue 23: uiautomatorviewer截图报错:Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn’t exist!

python+appium自动化测试遇到的一些坑及问题总结(三)

Solution: 关掉appium