因为想获取 toast 提示信息,尝试 以 Selendroid 模式启动 Appium 但是一直报错提示建立新 session 失败 如下

def setUp(self):

        desired_caps={}

        desired_caps['device'] = 'android'

        desired_caps['platformName']='Android'

        desired_caps['automationName']='Selendroid'

        desired_caps['browserName']=''

        desired_caps['noReset'] = True

        desired_caps['version']='4.3'

        desired_caps['deviceName']='SM-G7108V'

        desired_caps['app'] = PATH('C:\Program Files (x86)\Appium\golo.apk')

报错信息如下:

Traceback (most recent call last):
  File "C:\Users\Win-Attack\Desktop\test_get_toast.py", line 53, in setUp
    self.driver=webdriver.Remote('http://localhost:4723/wd/hub',desired_caps)
  File "C:\Python27\lib\site-packages\appium\webdriver\webdriver.py", line 36, in __init__
    super(WebDriver, self).__init__(command_executor, desired_capabilities, browser_profile, proxy, keep_alive)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 90, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 177, in start_session
    response = self.execute(Command.NEW_SESSION, capabilities)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "C:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
WebDriverException: Message: A new session could not be created. (Original error: Required platform doesn't exist (API level >= 17))

求解~希望各位大神帮助~ 或者有没有其他方式获取到 toast 进行比对 多谢各位啦


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