根据官网可以进行 calculator 和桌面 qq 的测试,但是我们公司的应用是 js 开发的,所以根据官网的 “AXPath” 方法获取不到元素。
像 iOS app 那样切 webview 也是失败的,只能起 driver,错误信息如下:
Traceback (most recent call last):
File "/Users/zhaona/PycharmProjects/Auto_mac_python/test/test_login.py", line 96, in
l.RCEdriver()
File "/Users/zhaona/PycharmProjects/Auto_mac_python/test/test_login.py", line 81, in RCEdriver
webview = driver.contexts.last
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/appium/webdriver/webdriver.py", line 59, in contexts
return self.execute(Command.CONTEXTS)['value']
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 312, in execute
self.error_handler.check_response(response)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/appium/webdriver/errorhandler.py", line 29, in check_response
raise wde
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/appium/webdriver/errorhandler.py", line 24, in check_response
super(MobileErrorHandler, self).check_response(response)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Could not find selector (get_contexts:) for path '/session/8jJJiC4z/contexts'.
appium log:

望路过的各位大大,给予帮助,非常感谢


↙↙↙阅读原文可查看相关链接,并与作者交流