python使用appium时出现错误
{“status”:100,“value”:{“error”:“invalid argument”,“message”:“Bad capabilities. Specify either app or appTopLevelWindow to create a session”}}
下方是生成的json内容,不能匹配winAppDriver的规则
{"capabilities":{"firstMatch":[{"platformName":"Windows","appium:app":"Microsoft.WindowsCalculator_8wekyb3d8bbwe!App","appium:deviceName":"WindowsPC","ms:experimental-webdriver":true}]}}
正确的内容应该是没有前缀"appium:",如下
{"capabilities": {"firstMatch": [{"platformName": "Windows", "appium:deviceName": "WindowsPC", "appium:app": "C:\\Windows\\System32\\notepad.exe"}]}, "desiredCapabilities": {"platformName": "Windows", "deviceName": "WindowsPC", "app": "C:\\Windows\\System32\\notepad.exe"}}
查询appium的文档说明,是因为2.0版本使用了与1.0版本不同的json生成公式,
可以使用1.0版本的appium-python-client 来替代
https://pypi.tuna.tsinghua.edu.cn/simple/appium-python-client/