Automating User Interface Testing with Instrument-利用Automation进行自动化测试
来源:互联网 发布:用python写网络爬虫pdf 编辑:程序博客网 时间:2024/05/16 06:46
一、需求场景
当我们做好一款app的时候,需要对其进行多次重复的功能测试时很有必要的。目前我做的项目AnyWhere就需要这么一个场景,需要不停的对其进行live和stop,检测crash的log.
原文地址http://blog.csdn.net/Smiling8866/article/details/51315358
二、解决方法
1、对于测试人员:
可以利用Appium,编写脚本进行自动化测试。当然还有其它的工具。这种测试不需要提供源码。
2.对于开发人员:
可以利用Instruments中的Automation框架进行自动化测试,只不过在测试之前需要对源码进行一次profile.
苹果官方提供的有这方面的文档,可以去官网查阅。不过,其给的文档看着有点怪怪的,所以我在下面把它的教程文档给翻译了一下。
原文地址http://blog.csdn.net/Smiling8866/article/details/51315358
三、对Automating User Interface Testing with Instrument 的翻译
1.什么是UI的自动化
- Automates UIKit based applications(界面的自动化依赖于app)
- Touch based(给予触摸的)
- IPhone,iPod touch band IPhone Simulator(支持IPhone,iPod,IPhone模拟器)
- Integrate in Instruments(在Instruments中被整合)
- Accessibility based (依赖于可接触性)
JavaScript automation scripts (脚本是用js写的)
2.对Elements的介绍
UIAElement——基类元素Name
- Value
- Elements
- Parent
……没耐心了,不想翻译了。。。
原文地址http://blog.csdn.net/Smiling8866/article/details/51315358
四、我的脚本
原文地址http://blog.csdn.net/Smiling8866/article/details/51315358
var target = UIATarget.localTarget();var app = target.frontMostApp();var window = app.mainWindow();var i = 0;var totalTimes = 100; // 测试总次数target.setDeviceOrientation(UIA_DEVICE_ORIENTATION_PORTRAIT);while(true){ UIALogger.logStart("AnyWherePro Automatic Test"); i++ target.delay(10); // 留10秒的时间刷新RList window.staticTexts()[9].tapWithOptions({tapOffset:{x:0.38,y:0.46}}); // 点击RList列表 target.delay(2); // 2秒钟展示RList的内容 window.tableViews()[1].tapWithOptions({tapOffset:{x:0.38,y:0.08}}); // 选择R target.delay(2); // 2秒钟展示选中的R的内容 target.tap({x:132.00,y:298.50}); // 点击屏幕,让RList折叠起来 window.buttons()["begin livingimage"].tap(); // 开始live var liveButton = window.buttons().withName("stop livingimage"); var screenImage_live = "screenshot_live"; var screenImage_stop = "screenshot_stop"; if(liveButton.isValid()){ UIALogger.logMessage("log info-------"+i+" time--------->start live success.."); target.captureScreenWithName(screenImage_live+i); }else{ UIALogger.logMessage("log info-------"+i+" time--------->start live failed.."); } target.setTimeout(30); target.delay(30); // live 30秒 window.buttons()["stop livingimage"].tap(); // 停止live liveButton = window.buttons().withName("begin livingimage"); if(liveButton.isValid()){ UIALogger.logMessage("log info-------"+i+" time--------->stop live success.."); target.captureScreenWithName(screenImage_stop+i); }else{ UIALogger.logMessage("log info-------"+i+" time--------->stop live failed.."); } if(i == totalTimes){ break; } UIALogger.logPass("AnyWherePro Automatic Test");}原文地址http://blog.csdn.net/Smiling8866/article/details/51315358
注意:一定要打开手机开发者选项中的允许自动化设置权限
0 0
- Automating User Interface Testing with Instrument-利用Automation进行自动化测试
- Instrument-Automation对IOS进行自动化测试(完整版)
- 自动化测试提纲(Automation Testing Outline)
- Xcode自带的instrument中的Automation实现自动化测试
- Android user interface testing with Robotium - Tutorial
- User Interface Testing Checklist
- Xcode自带的instrument中的Automation实现自动化测试简单使用
- Xcode自带的instrument中的Automation实现自动化测试简单使用
- Automation UI testing with VNC
- Automating UI Testing in Instruments User Guid(官方)
- Xcode6.2在终端使用Automation进行自动化测试
- 软件测试自动化之路(8)----如何做更好的GUI Automation Testing
- Automating UI Testing
- Automation自动化测试IOS设备
- Instrument Driver (iOS下的自动化测试)
- Testing the User Interface - Using DotNetMock
- 《Java Testing, Design, and Automation》:TestMaker是一个不错的开源web软件的自动化功能测试工具
- 利用Robotium进行安卓自动化测试
- POJ 2239 Selecting Courses(最大匹配数)
- zzuoj 1878: 蛤玮准备礼物
- 第十周项目3 警察和厨师继承组合类
- MBProgressHUD
- hrbust 2115,哈理工oj 2115 Equal【dfs+剪枝】
- Automating User Interface Testing with Instrument-利用Automation进行自动化测试
- 字符转换为数字的方法
- 项目开发模型
- load data infile 补充
- 如何让Mac应用程序重置
- 浏览器的userAgent识别
- C语言malloc的使用浅谈
- 二叉树中序遍历的非递归算法
- php 操作redis