Appium Appium for iOS 真机测试报错问题合集

王明海 · 2016年05月26日 · 最后由 Jackey 回复于 2016年05月27日 · 1314 次阅读

测试环境:Appium 1.4.13
Appium 报错日志:

info: [debug] Couldn't find ideviceinstaller, trying built-in at /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller

error: Could not initialize ideviceinstaller; make sure it is installed and works on your system
共收到 6 条回复 时间 点赞

解决方法:brew install --HEAD ideviceinstaller
https://testerhome.com/topics/3129

#1 楼 @heminwon iOS 上能用 execute_script 么?

—— 来自 TesterHome 官方 安卓客户端

#2 楼 @app_test 当然可以。

不是说合集吗。。。怎么只有一个问题。。。

#4 楼 @chenhengjie123 会慢慢添加上来,确保都是自己踩过的坑,而不是网上收集整理

#3 楼 @lihuazhang 我这边在脚本中执行 execute_scripte 报错,
脚本如下:

wd.execute_script("var obj1=document.getElementById(\"loginUsername\");obj1.setAttribute(\"value\",\"yzt200\")")

log 如下:

File "ios.py", line 49, in <module>
    wd.execute_script("var obj1=document.getElementById(\"loginUsername\");obj1.setAttribute(\"value\",\"yzt200\")")
  File "/Library/Python/2.7/site-packages/selenium-2.48.0-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 429, in execute_script
    {'script': script, 'args':converted_args})['value']
  File "/Library/Python/2.7/site-packages/selenium-2.48.0-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 201, in execute
    self.error_handler.check_response(response)
  File "build/bdist.macosx-10.10-intel/egg/appium/webdriver/errorhandler.py", line 29, in check_response
selenium.common.exceptions.WebDriverException: Message: null is not an object (evaluating 'obj1.setAttribute')

还有一个现象:current_context webview_1,这个后面的 1 序号每执行一次就增加 1,是不是缓存引起的?怎么破?

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