Appium appium (1.9.1)+ python 执行 iOS 应用的自动化,driver.background_app (3) 这个命令不能实现切换后台操作了,求解?

lei · 2018年12月26日 · 最后由 testcomityan 回复于 2019年07月03日 · 1675 次阅读

执行到 driver.background_app(3) 的时候,提示错误:WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Error Domain=com.facebook.WebDriverAgent Code=1 "Timeout waiting until SpringBoard is visible" UserInfo={NSLocalizedDescription=Timeout waiting until SpringBoard is visible}

共收到 15 条回复 时间 点赞

更改 wda 的 WebDriverAgent/blob/master/WebDriverAgentLib/FBSpringboardApplication.m 文件
最后的返回为
return self.otherElements[@"Dock"].isEnabled || self.otherElements[@"程序坞"].isEnabled; 问题解决。

lei #2 · 2018年12月26日 Author

hello,大牛,我直接把你给的代码添加到文件中,,但是还是提示和之前相同的错误,我是哪里没改对?

lei #3 · 2018年12月26日 Author

代码中的输出需要改一下?

lei #4 · 2018年12月26日 Author

我现在的环境:appium:1.9.1,xcode:10,python:2.7.13;另外,能大概讲一下这个问题的原因吗?辛苦大牛。

appium1.9 的,用下 python3.5 以上试试,这个要版本匹配的

lei #6 · 2018年12月26日 Author

由于历史原因,python 的版本不能改,如果改的话,需要大改。

lei #7 · 2018年12月27日 Author
向阳 回复

请大神帮忙指点一下。按照你说的方式,修改了返回,还是提示之前一样的问题,还需要修改什么地方吗?

lei 回复

wda 要重新编译运行到手机上

lei #9 · 2019年01月04日 Author
向阳 回复

我把手机上的 wda 删除了,重新安装并启动,还是不行。

@lei 什么手机,语言设置的啥, 还是报原来的错吗

lei #11 · 2019年01月04日 Author
向阳 回复

还是原来的错误,手机是 iPhone X,语言设置的简体中文。

lei #12 · 2019年01月04日 Author

WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Error Domain=com.facebook.WebDriverAgent Code=1 "Timeout waiting until SpringBoard is visible" UserInfo={NSLocalizedDescription=Timeout waiting until SpringBoard is visible}
还是这个错误提示

@lei 这个错就是找不到桌面的问题,修改之后重新编译运行,应该是没问题的,有点怀疑你没改对或重新编译运行的不对,检查检查。

lei #14 · 2019年01月04日 Author
向阳 回复

好的,我检查一下,谢谢。

我也遇到这个问题,按照你说的修改后可以了,哈哈 非常感谢

需要 登录 後方可回應,如果你還沒有帳號按這裡 注册