2013年11月14日

摘要: 一个测试程序包含一个或多个测试用例,它们都继承自Android TestCase类。选择一个测试用例类取决于你要测试的Android组件的类型以及你要做什么样的测试。一个测试程序可以测试不同的组件,但每个测试用例类设计时只能测试单一类型的组件。一 些Android组件有多个关联的测试用例类。在这种情况下,在可选择的类间,你需要判断你要进行的测试类型。例如,对于Activity来说,你有两个 选择,ActivityInstrumentationTestCase2和ActivityUnitTestCase。ActivityInstrumentationTestCase2设计用于进行一些功能性的测试 阅读全文
posted @ 2013-11-14 16:57 zhitang2009 阅读(1121) 评论(0) 推荐(0) 编辑
摘要: http://www.pip-installer.org/en/latest/installing.html 下载py文件到python安装目录执行命令:python ez_setup.pypython get-pip.py屏幕显示:Installing pip-script.py script to D:\Python33\ScriptsInstalling pip.exe script to D:\Python33\ScriptsInstalling pip-3.3-script.py script to D:\Python33\ScriptsInstalling pip-3.3.exe 阅读全文
posted @ 2013-11-14 15:52 zhitang2009 阅读(508) 评论(0) 推荐(0) 编辑
摘要: gem install selenium-webdriver1、驱动不同的浏览器,需要下载不同的驱动 例如:chromedriver.exe IEDriverServer.exe;如果没有默认驱动火狐浏览器。chrome的驱动支持28以上chrome版本2、不同的语言,有不同的驱动3、用ruby写selenium脚本时,脚本名字要有所区分,有两个脚本ruby.rb ruby02.rb,前者驱动ie,后者驱动chrome测试,执行ruby02.rb时,发现ie被激活了; 改名ruby01.rb ruby02.rb后,该问题消失4、运行过程中如果出现WebDriverException: Mess 阅读全文
posted @ 2013-11-14 15:50 zhitang2009 阅读(260) 评论(0) 推荐(0) 编辑
摘要: android自动化测试原理:1、将测试apk和被测试apk,运行在一个进程中;通过instrumentation进行线程间的通信2、通过android.test.AndroidTestCase及其子类,控制android系统对象3、通过android.test.InstrumentationTestCase 及其子类,测试Activity被测试程序的manifest文件中要指定被测试程序,如下:4、当你运行一个测试程序时,首先会运行一个系统工具叫做Activity Manager。Activity Manager使用Instrumentation框架来启动和控制TestRunner,这个Te 阅读全文
posted @ 2013-11-14 12:36 zhitang2009 阅读(1659) 评论(0) 推荐(0) 编辑
摘要: android平台测试支撑主架构如下:1、Instrumentationjava.lang.Object ↳ android.app.Instrumentation (Android测试环境的核心,通过将主程序和测试程序运行在同一个进程来实现;允许测试用例访问程序的状态及运行时对象)java.lang.Object ↳ android.app.Instrumentation ↳ android.test.InstrumentationTestRunner (测试执行类,清单文件中必须配置;我们使用adb shell am instrument.....命令时,必须指定该类,或... 阅读全文
posted @ 2013-11-14 12:31 zhitang2009 阅读(889) 评论(0) 推荐(0) 编辑
摘要: adb使用手册http://developer.android.com/tools/help/adb.htmlAndroid Debug Bridge version 1.0.31 -a - directs adb to listen on all interfaces for a connection -d - directs command to the only connected USB device returns an error if more than one ... 阅读全文
posted @ 2013-11-14 11:15 zhitang2009 阅读(406) 评论(0) 推荐(0) 编辑
摘要: 最近常用到的adb命令adb -s emulator-5554 shell am instrument -w -e class cn.mama.activity.test.TestMMQ cn.mama.activity.test/android.test.InstrumentationTestRunneradb shell am instrument -w -e class cn.mama.activity.test.TestMMQ cn.mama.activity.test/android.test.InstrumentationTestRunneradb uninstall cn.mam 阅读全文
posted @ 2013-11-14 10:58 zhitang2009 阅读(839) 评论(0) 推荐(0) 编辑
摘要: 程序不能执行,kill掉任务管理器里面adb服务,重新连接设备仍然有错查到可能是adb端口被占用查看adb用的是哪个端口:C:\Users\wanglin>adb nodaemon server查看谁占用了这个端口:C:\Users\wanglin>netstat -ano | findstr "5037"可以打开任务管理器关闭该进程。更方便的是用命令行直接kill该进程:taskkill /F /PID 6292http://blog.csdn.net/wanglin754/article/details/8625367360手机管理经常占用5037端口,估计 阅读全文
posted @ 2013-11-14 10:55 zhitang2009 阅读(1024) 评论(0) 推荐(0) 编辑

导航