2013年11月14日

摘要: 一个测试程序包含一个或多个测试用例,它们都继承自Android TestCase类。选择一个测试用例类取决于你要测试的Android组件的类型以及你要做什么样的测试。一个测试程序可以测试不同的组件,但每个测试用例类设计时只能测试单一类型的组件。一 些Android组件有多个关联的测试用例类。在这种情况下,在可选择的类间,你需要判断你要进行的测试类型。例如,对于Activity来说,你有两个 选择,ActivityInstrumentationTestCase2和ActivityUnitTestCase。ActivityInstrumentationTestCase2设计用于进行一些功能性的测试 阅读全文
posted @ 2013-11-14 16:57 zhitang2009 阅读(1120) 评论(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 阅读(507) 评论(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 阅读(259) 评论(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 阅读(1647) 评论(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 阅读(888) 评论(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 阅读(808) 评论(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 阅读(1013) 评论(0) 推荐(0) 编辑

2013年11月12日

摘要: apktool-***.zip解压后apktool.bat d -f apk的url 反编译后的目录查看渠道在\res\values目录中的strings.xml里面的platform_id值。看是否和APK的名字一样打包时渠道号错误,会浪费公司推广资源。为了节省研发测试对渠道包渠道号的验证时间,在反编译工具基础上,结合bat和php 脚本,写了个小工具。使用方法如下:渠道号自动校验脚本:1、环境准备安装JDK,配置环境变量安装PHP,配置环境变量2、下载apktool-install-windows-r05-ibot.zip,解压3、把要校验的渠道包,复制到source目录4、运行-》cmd 阅读全文
posted @ 2013-11-12 17:01 zhitang2009 阅读(1138) 评论(2) 推荐(1) 编辑
摘要: 今天写robotium脚本时,遇到两个输入框:第一个输入框用方法 solo.typeText(et_username, "mama1888"); 可以输入;第二个不行,要使用 solo.enterText(et_write_title, "帖子标题"); 才可以输入。哪位大虾能告之这两个方法有什么不一样??1、实现上,typeText方法是robotium框架调用系统Instrumentation类里面的sendStringSync方法来实现的;enterText是调用TextView里面setText方法来实现的。2、显示上,typeText在测试过程 阅读全文
posted @ 2013-11-12 15:33 zhitang2009 阅读(583) 评论(0) 推荐(0) 编辑

导航