美文网首页
bye, send_keys

bye, send_keys

作者: 小安静子 | 来源:发表于2017-08-01 23:34 被阅读25次

最近搞代码,老出现这个错:

 Parameters were incorrect. We wanted {"required":["value"]} and you sent ["text","value","id","sessionId"]

弄了好久,也没弄出来。
然后看到一个bug
appium issue
说是高版本的selenium不支持。
别人的解决方案:

pip uninstall selenium
pip install selenium==3.3.1

但是仍然没解决我的问题。
于是我自己封装了个函数

def send_text(self,text): #adb 不支持中文输入
   os.popen('adb shell input text {}'.format(text))

问题解决了。

但是我发现,还有个更好的办法。
selenium 3.4后send_keys,就用不了了, 取而代之的是set_value,输入速度提高了很多

set_value(element,str)

终于解决了,浪费了我好多时间。

更多精彩,请关注 微信公众号: python爱好部落

qrcode_for_gh_ca85abea157e_430.jpg

相关文章

网友评论

      本文标题:bye, send_keys

      本文链接:https://www.haomeiwen.com/subject/lqfkfxtx.html