appium测试ios应用遇到的问题
2016-01-05 18:17
417 查看
1、在真机上跑APPIUM,需要指定udid,如果机子已安装ipa应用则app参数用bundle id,如果未安装,app参数使用app的路径
appium -U UDID --app Bundle ID
1)模拟器的服务端配置(如果使用ios模拟器,需要源码编译安装,而且app参数需要指定ipa应用路径):
然后切换Advanced中勾选Use Native Instruments Library
客户端desired_caps配置
desired_caps_ios={'platformVersion':'9.2',
'deviceName':'iphone6',
'app':'/user/library/XXX.ipa',
'platformName':'IOS',
}
2)真机的服务端配置(如果是真机,需要指定udid):
客户端desired_caps配置
desired_caps_ios={'platformVersion':'8.1',
'deviceName':'iphone',
'app':'com.500.coyote.',
'platformName':'IOS',
}
2、启动app遇到crash(两种情况)
(1)selenium.common.exceptions.WebDriverException: Message: u'A new session could not be created. (Original error: Instruments crashed on startup)'
是因为developer选项里的 Enable UI Automation木有开启,开启后就OK了。在真机上跑APPIUM的前提是,手机连mac电脑,打开xcode就可以注册成开发者手机,这样就可以在Settings的页面看到 Developer(开发者)这个选项了。
(2)"message":"A new session could not be created. (Original error: Instruments crashed on startup)","origValue":"Instruments crashed on startup"},"sessionId":null}
一般出现这个问题,都是你的APP的签名跟设备的不一样导致,用xcode debug重新安装一个即可。
3、Platform Version 是一个文本框,如果测试的机型版本比较高,可以自己填写版本的,注意如果是自定义版本,请勾选IOS Setting->advanceed ->Use Native Instruments Library
4、用appium inspector定位出来的type可以用class name定位,name可以用name定位,xpath用xpath定位
5、真机系统是ios9以上的,在刚安装程序第一次启动前,需要在设置-通用-描述文件与设备管理-企业级应用中找到你的程序对应文件点进去信任该应用才能启动应用。
appium -U UDID --app Bundle ID
1)模拟器的服务端配置(如果使用ios模拟器,需要源码编译安装,而且app参数需要指定ipa应用路径):
然后切换Advanced中勾选Use Native Instruments Library
客户端desired_caps配置
desired_caps_ios={'platformVersion':'9.2',
'deviceName':'iphone6',
'app':'/user/library/XXX.ipa',
'platformName':'IOS',
}
2)真机的服务端配置(如果是真机,需要指定udid):
客户端desired_caps配置
desired_caps_ios={'platformVersion':'8.1',
'deviceName':'iphone',
'app':'com.500.coyote.',
'platformName':'IOS',
}
2、启动app遇到crash(两种情况)
(1)selenium.common.exceptions.WebDriverException: Message: u'A new session could not be created. (Original error: Instruments crashed on startup)'
是因为developer选项里的 Enable UI Automation木有开启,开启后就OK了。在真机上跑APPIUM的前提是,手机连mac电脑,打开xcode就可以注册成开发者手机,这样就可以在Settings的页面看到 Developer(开发者)这个选项了。
(2)"message":"A new session could not be created. (Original error: Instruments crashed on startup)","origValue":"Instruments crashed on startup"},"sessionId":null}
一般出现这个问题,都是你的APP的签名跟设备的不一样导致,用xcode debug重新安装一个即可。
3、Platform Version 是一个文本框,如果测试的机型版本比较高,可以自己填写版本的,注意如果是自定义版本,请勾选IOS Setting->advanceed ->Use Native Instruments Library
4、用appium inspector定位出来的type可以用class name定位,name可以用name定位,xpath用xpath定位
5、真机系统是ios9以上的,在刚安装程序第一次启动前,需要在设置-通用-描述文件与设备管理-企业级应用中找到你的程序对应文件点进去信任该应用才能启动应用。
相关文章推荐
- ios import和@class的区别
- Android TextView前加图标垂直居中第一行(仿大众点评购买须知/提示语)
- iOS多线程之NSThread
- Android 应用程序升级到 5.0 需要注意的问题
- 微型 ORM 的第一篇 DapperLambda发布
- unity3d将一张图片切成多张图片
- android中的文件操作详解以及内部存储和外部存储
- Android 使用动态加载框架DL进行插件化开发
- 细说:AndroidStudio插件
- 在Android中 使用 java.net.URI 与 android.net.Uri 的区别
- android的TextView展示带格式文本、首行缩进、引入自定义字体
- ios 自适应高度
- ios多级跳动
- Android5.0 与 4.x的不同
- iOS如何在一个view上 显示两个tableview
- iOS开发中的键盘高度变化处理
- AndroidStudio多渠道打包
- iOS 给category添加属性的小技巧
- cocos2dx - 在MFC中使用cocos2dx
- iOS持久化之CoreData(待总结)