关于Appium使用问题合集(sample-code)

最近在研究Appium做UI自动化测试,下面是在这过程中遇见的各种问题,本问题合集使用sample-code进行测试

Appium测试TestAPP时报错解决方法

1. Xcode-Version 7.3.1 (7D1014)使用Appium提供的测试用例TestAPP时编译时报错:

/Users/HeminWon/Desktop/sample-code-master/sample-code/apps/TestApp/Test App 2/GestureTestViewController.xib: Internal error. Please file a bug at bugreport.apple.com and attach "/var/folders/0m/mm1tf5394t78gnkpxt9jnslc0000gn/T/IB-agent-diagnostics_2016-05-19_23-31-34_869000".

解决方法:
BuildSetting -> Build Settings -> OSACompile-Build Options -> Save as Execute-Only - > No→Yes
参考来源:LaunchScreen-iPad.xib internal error.

2. 全局代理模式下运行appium时,python运行脚本不成功

原因:因全局代理模式下下无法访问到127.0.0.1,所以请关闭全局代理.

3. 使用测试用例TestAPP,终端运行脚本ios_simple.py时,Appium报出以下错误

error: Could not reset simulator. Leaving as is. Error: Command 'xcrun simctl erase 3E6EEACD-7542-447F-B768-2C8FE8B0975E' exited with code 159

解决方法:在Appium的GUI客户端中打开使用本地仿真库
Appium -> iOS Settings - > Advanced -> Use Native Instruments Library 这个选项打上勾
参考来源:Appium not running iOS Simulator - Mac OSX El Capitan

4. 使用测试用例UICatalog,运行脚本ios_complex.py时,Appium无法自动化测试并报出以下错误

Traceback (most recent call last):
   File "ITest0623.py", line 9, in <module> 
    from appium import webdriver 
ImportError: No module named appium 

解决方法:安装的python-client使用Homebrew未完全安装正确,使用Git下载python-client安装

git clone https://github.com/appium/python-client
# cd到下载的python-client
cd python-client
#以下命令可能需要使用sudo命令
python setup.py install 

参考来源:http://www.jianshu.com/p/a359a43fc48f

5. 使用测试用例UICatalog,运行脚本ios_complex.py时,Appium日志显示以下错误

error: Failed to start an Appium session, err was: Error: Bad app: /Users/hulianghai/Desktop/sample-code/sample-code/apps/UICatalog/build/release-iphonesimulator/UICatalog.app. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Error locating the app: ENOENT, stat '/Users/hulianghai/Desktop/sample-code/sample-code/apps/UICatalog/build/release-iphonesimulator/UICatalog.app'

错误原因:未注意脚本语言里面“app = os.path.abspath”设置的路径需要与客户端Appium测试的app路径保持一致,参考其他脚本或者官方文档重新设置路径

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,217评论 25 708
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,908评论 18 139
  • 22年12月更新:个人网站关停,如果仍旧对旧教程有兴趣参考 Github 的markdown内容[https://...
    tangyefei阅读 35,223评论 22 257
  • 最近被很多人带着学着评价演员的演技。 可见其实我对于演技没什么评价能力,所以才想要学习,可是学来学去还是不太明白。...
    南来北往_小Anrt阅读 286评论 0 0