当前位置: 首页 > news >正文

做网站销售工资怎么样特价锦州网站建设

做网站销售工资怎么样,特价锦州网站建设,专业制作网站是什么,搜索引擎网站分析UI Automator为Android程序的UI开发提供了测试环境,这里我们就来看一下Android App开发的自动化测试框架UI Automator使用教程,需要的朋友可以参考下 Android的自动化测试有很多框架#xff0c;其中ui automator是google官方提供的黑盒UI相关的自动化测试工具#xff0c;其中ui automator是google官方提供的黑盒UI相关的自动化测试工具GitHub主页case使用java写今天实践了一下官方文档中样例程序其中还是有一些小问题需要总结一下的。 环境准备 1.JDK(是的你没看错基础的android开发环境必备)以及对应的环境变量配置不会的可以自己百度下下 2.Android Studio(IDE尊崇个人意愿) 3.android SDK以及配置 4.ANT主要用于build我们的脚本生成jar包 ant的搭建主要分几步 1.下载ant安装文件并且解压安装 2.新建系统环境变量ANT_HOME参数值是你的ant安装目录 3.在Path环境变量中添加ant安装目录的bin文件夹比如我的就是C:\cod\apache-ant-1.9.6\bin 4.配置完以后测试一下在命令行下输入ant -version如果显示你所安装的ant版本信息证明环境变量配置成功 使用流程 1、使用ADT创建一个java的项目 在创建项目的时候要加上JUnit与你使用的Android platforms中对应的android.jar与uiautomator.jar 2、新建一个包(我这里就只叫com) 3、再这个包下创建一个class输入以下java代码,代码全是官方文档上的代码除了最上面的package package com;import com.android.uiautomator.core.UiObject; import com.android.uiautomator.core.UiObjectNotFoundException; import com.android.uiautomator.core.UiScrollable; import com.android.uiautomator.core.UiSelector; import com.android.uiautomator.testrunner.UiAutomatorTestCase;public class Runer extends UiAutomatorTestCase { public void testDemo() throws UiObjectNotFoundException { // Simulate a short press on the HOME button.getUiDevice().pressHome();// Were now in the home screen. Next, we want to simulate // a user bringing up the All Apps screen.// If you use the uiautomatorviewer tool to capture a snapshot // of the Home screen, notice that the All Apps buttons // content-description property has the value “Apps”. We can // use this property to create a UiSelector to find the button. UiObject allAppsButton new UiObject(new UiSelector().description(Apps));// Simulate a click to bring up the All Apps screen.allAppsButton.clickAndWaitForNewWindow();// In the All Apps screen, the Settings app is located in // the Apps tab. To simulate the user bringing up the Apps tab,// we create a UiSelector to find a tab with the text // label “Apps”.UiObject appsTab new UiObject(new UiSelector().text(Apps));// Simulate a click to enter the Apps tab.appsTab.click();// Next, in the apps tabs, we can simulate a user swiping until// they come to the Settings app icon. Since the container view // is scrollable, we can use a UiScrollable object.UiScrollable appViews new UiScrollable(new UiSelector().scrollable(true));// Set the swiping mode to horizontal (the default is vertical)appViews.setAsHorizontalList();// Create a UiSelector to find the Settings app and simulate // a user click to launch the app. UiObject settingsApp appViews.getChildByText(new UiSelector().className(android.widget.TextView.class.getName()), Settings);settingsApp.clickAndWaitForNewWindow();// Validate that the package name is the expected oneUiObject settingsValidation new UiObject(new UiSelector().packageName(com.android.settings));assertTrue(Unable to detect Settings, settingsValidation.exists()); UiObject reportBug new UiObject(new UiSelector().text(Sound));reportBug.clickAndWaitForNewWindow();UiObject soundValidation new UiObject(new UiSelector().text(Volumes));assertTrue(Unable to detect Sound, soundValidation.exists()); getUiDevice().pressHome();} } 4、使用ant工具生成build.xml 我这里在使用ADT自已的ant插件时提示 build.xml:26: Class not found: javac1.8网上查了查是插件与我java环境不符下载最新的ant插件就可以了http://ant.apache.org/bindownload.cgi  下载这个tar.gz包解压然后将apache-ant-1.9.4\bin目录添加到环境变量PATH中 然后cmd到android sdk的tools目录使用andrlid list命令记住你将要在模拟器中运行的(也是你刚刚导入android.jar与uiautomator.jar包时所在的platforms) 在cmd下使用 android create uitest-project -n name -t android-sdk-ID -p path-n 为生成的jar包名称自已任意定义 -t 为上面查看到的值我这里是1 -p 为输出路径这里就是刚才创建的java项目所在的路径 android create uitest-project -n AutoRunner -t 1 -p D:\myAndroidStudy\androidTest然后再cmd进入D:\myAndroidStudy\androidTest使用ant build命令生成AutoRunner.jar文件 5、将这个AutoRunner.jar文件push到模拟器中 adb push AutoRunner.jar /data/local/tmp6、使用 adb shell uiautomator runtest AutoRunner.jar –c com.Runer 使Runer类运行 我的代码里又在官方基础上多了一个点击”sound”的操作与点击Home键操作 UiObject reportBug new UiObject(new UiSelector().text(Sound));reportBug.clickAndWaitForNewWindow();UiObject soundValidation new UiObject(new UiSelector().text(Volumes));assertTrue(Unable to detect Sound, soundValidation.exists()); getUiDevice().pressHome();image这个其实也只是一个简单的玩具代码没有什么意义但是官方作为一个引导其中也使用了一些最常见的接口。以后再深入的学习uiautomator 总结 优点 1.可以对所有操作进行自动化操作简单 2.不需要对被测程序进行重签名且可以测试所有设备上的程序比如~某APP比如~拨号比如~发信息等等 3.对于控件定位要比robotium简单一点点 缺点 1.uiautomator需要android level 16以上才可以使用因为在level 16及以上的API里面才带有uiautomator工具 2.如果想要使用resource-id定位控件则需要level 18及以上才可以 3.对中文支持不好不代表不支持第三方jar可以实现 4.个人感觉控件定位不如robotium那样层级分明仅仅个人感觉用户行为注入还是和插桩有点点区别的 ​现在我也找了很多测试的朋友做了一个分享技术的交流群共享了很多我们收集的技术文档和视频教程。 如果你不想再体验自学时找不到资源没人解答问题坚持几天便放弃的感受 可以加入我们一起交流。而且还有很多在自动化性能安全测试开发等等方面有一定建树的技术大牛 分享他们的经验还会分享很多直播讲座和技术沙龙 可以免费学习划重点开源的 qq群号485187702【暗号csdn11】 最后感谢每一个认真阅读我文章的人看着粉丝一路的上涨和关注礼尚往来总是要有的虽然不是什么很值钱的东西如果你用得到的话可以直接拿走 希望能帮助到你【100%无套路免费领取】
http://www.zqtcl.cn/news/489652/

相关文章:

  • 网站建设的摘要做直播网站赚钱吗
  • 网站建设明细报价表模板永久免费云服务器无需注册
  • 扁平化网站设计方案大学生做的美食网站
  • wordpress前台打开速度20秒湖南正规竞价优化公司
  • 深度网营销型网站建设wordpress keywords
  • 企业官网快速建站框架物流网站源代码
  • 网站图片设置隐私保护怎么下载搭建购物网站
  • 网站运营和推广可以做mv 的视频网站
  • 成都网站建设冠辰成都关键词优化技术
  • 用什么框架做网站快哪个网站可以自己做名片
  • 免费网站建设ppt模板下载网站设计与程序专业
  • o2o网站设计方案高端定制网站开发设计建站流程
  • 杭州建设公司网站石家庄做网站比较好的公司
  • 英文网站支付怎么做产品做推广都有那些网站
  • 自己做的网站怎么加入微信支付综合性门户网站列举
  • 哪个网站 可以做快递单录入网站怎么做抽奖
  • 网站设计培训班网站域名费用怎么做分录
  • 济南做网站哪里好惠州附近公司做网站建设多少钱
  • 使用oss做静态网站网站广告牌制作教程
  • 外贸看的英文网站公众号模板编辑器
  • 做网站的数据库的步骤阅读网站模板下载
  • 建设网站要钱吗个人养老金制度是什么意思
  • 做h5的网站页面设计软文素材网站
  • 黄冈网站推广软件费用是多少手机网站弹出层插件有哪些
  • wordpress文章链接怎么改怎么优化关键词排名优化
  • 专业做包包的网站好产品网站做营销推广
  • 网站刚建好怎么做能让百度收录湖北黄石网站建设
  • 网站建设拾金手指下拉二一wordpress 插件破解
  • 天津做网站外包公司有哪些美橙互联网站
  • 石家庄网站建设蓝点办公室装修工程