Appium mac 上启动 appium,用 Python 执行自动化脚本,提示 WebDriverException : Message : Parameters were incorrect.

lei · 2017年05月16日 · 最后由 lei 回复于 2017年08月28日 · 1441 次阅读

mac 版本:10.12.4
Appium 版本:1.6.4
Xcode 版本:8.3.2
mac 上启动 appium,用 Python 执行自动化脚本,提示

ERROR: test_action (main.SimpleIOSTests)

Traceback (most recent call last):
File "ios_simple_simulator.py", line 31, in setUp
'udid': '1cb61c36689374c0ff75d8bd1be5e778642c32ed',
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/appium/webdriver/webdriver.py", line 36, in init
super(WebDriver, self).init(command_executor, desired_capabilities, browser_profile, proxy, keep_alive)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 98, in init
self.start_session(desired_capabilities, browser_profile)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 188, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in execute
self.error_handler.check_response(response)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 165, in check_response
raise exception_class(value)
WebDriverException: Message: Parameters were incorrect. We wanted {"required":["desiredCapabilities"],"optional":["requiredCapabilities","sessionId","id"]} and you sent ["capabilities","desiredCapabilities"]

有没有遇到这种情况的?帮忙解答一下。
@Lihuazhang 能帮忙解答一下这个问题吗 ?

共收到 8 条回复 时间 点赞

请问下,你用的是 desktop 版本吗,支持脚本录制吗

先看下你的 selenum 版本是不是太高了,如果太高建议降级 pip install seniun 版本号

https://github.com/SeleniumHQ/selenium/issues/4017#issuecomment-302030078

可能跟引用的 webdriver 变更规范有关系,建议降版本组合尝试看是否能稳定。

遇到了类似问题,楼主该问题有解决吗?我在运行的时候提示是这个:
[debug] [MJSONWP] Bad parameters: BadParametersError: Parameters were incorrect. We wanted {"required":["value"]} and you sent ["text","sessionId","id","value"]

我也是这个问题

ChelseaZhang 回复

请问解决你这个问题了吗?

7楼 已删除
lei #8 · 2017年08月28日 Author

webdriverexception: message: parameters were incorrect. we wanted {"required":["value"]} you sent ["text","sessionid","id","value”] 报这个错误,找到原因是 selenium 版本的问题,把 selenium 版本降到 3.0.1 就可以了
首先要先到 Python 的第三方目录里面(pip show selenium 查看路径)/Library/Python/2.7/site-packages 删除老版本的 selenium,然后安装要安装的版本 pip install selenium==3.0.1
可以看看这个:http://yiweifen.com/html/news/ZhiYeZiGe/162728.html

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册