appium简明教程(1)——appium和它的哲学世界
什么是appium?
本文已经迁移到测试教程网,后续更新会在测试教程网更新。
下面这段介绍来自于appium的官网。
Appium is an open-source tool you can use to automate mobile native, mobile web, and mobile hybrid applications on iOS and Android platforms. “Mobile native apps” are those written using the iOS or Android SDKs. “Mobile web apps” are web apps accessed using a mobile browser (Appium supports Safari on iOS and Chrome on Android). “Mobile hybrid apps” have a native wrapper around a “webview” – a native control that enables interaction with web content. Projects like Phonegap, for example, make it easy to build apps using web technologies that are then bundled into a native wrapper – these are hybrid apps.
Importantly, Appium is “cross-platform”: it allows you to write tests against multiple platforms (iOS, Android), using the same API. This enables a large or total amount of code reuse between iOS and Android testsuites.
我们可以从上面的介绍里获得这样的一些信息:
- 1,appium是开源的移动端自动化测试框架;
- 2,appium可以测试原生的、混合的、以及移动端的web项目;
- 3,appium可以测试ios,android应用(当然了,还有firefox os);
- 4,appium是跨平台的,可以用在osx,windows以及linux桌面系统上;
appium的哲学
Appium was designed to meet mobile automation needs according to a certain philosophy. The key points of this philosophy can be stated as 4 requirements:
- You shouldn’t have to recompile your app or modify it in any way in order to automate it.
- You shouldn’t be locked into a specific language or framework to write and run your tests.
- A mobile automation framework shouldn’t reinvent the wheel when it comes to automation APIs.
- A mobile automation framework should be open source, in spirit and practice as well as in name!
appium的设计哲学是这样的:
- 1,不需要为了自动化而且重新编译或修改测试app;
- 2,不应该让移动端自动化测试限定在某种语言和某个具体的框架;也就是说任何人都可以使用自己最熟悉最顺手的语言以及框架来做移动端自动化测试;
- 3,不要为了移动端的自动化测试而重新发明轮子,重新写一套惊天动地的api;也就是说webdriver协议里的api已经够好了,拿来改进一下就可以了;
- 4,移动端自动化测试应该是开源的;
appium的技术架构
- OS: Apple’s UIAutomation
- Android 4.2+: Google’s UiAutomator
- Android 2.3+: Google’s Instrumentation. (Instrumentation support is provided by bundling a separate project, Selendroid)
appium的设计思想
We meet requirement #2 by wrapping the vendor-provided frameworks in one API, theWebDriver API. WebDriver (aka “Selenium WebDriver”) specifies a client-server protocol (known as the JSON Wire Protocol). Given this client-server architecture, a client written in any language can be used to send the appropriate HTTP requests to the server. There are already clients written in every popular programming language. This also means that you’re free to use whatever test runner and test framework you want; the client libraries are simply HTTP clients and can be mixed into your code any way you please. In other words, Appium & WebDriver clients are not technically “test frameworks” – they are “automation libraries”. You can manage your test environment any way you like!
We meet requirement #3 in the same way: WebDriver has become the de facto standard for automating web browsers, and is a W3C Working Draft. Why do something totally different for mobile? Instead we have extended the protocol with extra API methods useful for mobile automation.
It should be obvious that requirement #4 is a given – you’re reading this because Appium is open source.
首先,为了能够实现哲学里描述的第2条,也就是不应该让移动端自动化测试限定在某种语言和某个具体的框架;也就是说任何人都可以使用自己最熟悉最顺手的语言以及框架来做移动端自动化测试;appium选择了client-server的设计模式。只要client能够发送http请求给server,那么的话client用什么语言来实现都是可以的,这就是appium及webdriver如何做到支持多语言的;
其次,为了能够实现不要为了移动端的自动化测试而重新发明轮子,重新写一套惊天动地的api;也就是说webdriver协议里的api已经够好了,拿来改进一下就可以了;这个思想,appium扩展了webdriver的协议,没有自己重新去实现一套。这样的好处是以前的webdriver api能够直接被继承过来,以前的webdriver各种语言的binding都可以拿来就用,省去了为每种语言开发一个client的工作量;
最后appium当然是开源的,这也实现了哲学思想里的最后一点。
下一节讲介绍appium的一些基本概念。
本文版权归乙醇所有,欢迎转载,但请注明作者与出处,严禁用于任何商业用途
appium简明教程(1)——appium和它的哲学世界的更多相关文章
- appium简明教程
appium简明教程 什么是appium? 下面这段介绍来自于appium的官网. Appium is an open-source tool you can use to automate mobi ...
- 转载乙醇大师的appium简明教程
appium简明教程(11)——使用resource id定位(仅支持安卓4.3以上系统) 乙醇 2014-06-28 21:01 阅读:16406 评论:21 appium简明教程(10)——控件定 ...
- appium简明教程(6)——启动appium及android模拟器
一般情况下,我们都从命令行启动appium. windows下,dos命令窗口输入 appium 如果该命令报错,那么请重装appium npm install -g appium 如果安装出错,请自 ...
- appium简明教程(3)——appium的安装windows版
appium的哲学里有一条就是不重新发明轮子.同样,官方已经有明确的安装步骤了,因此在这里纯属搬砖. 原文地址 感谢testerhome的辛勤翻译. 本文版权归乙醇所有,欢迎转载,但请注明作者与出处, ...
- appium简明教程(11)——使用resource id定位(仅支持安卓4.3以上系统)
上一节乙醇带大家了解了appium的定位策略.实际上appium的控件定位方式是完全遵守webdriver的mobile扩展协议的. 这一节将分享一下如何使用resource id来定位android ...
- appium简明教程(4)——appium client的安装
appium client是对webdriver原生api的一些扩展和封装.它可以帮助我们更容易的写出用例,写出更好懂的用例. appium client是配合原生的webdriver来使用的,因此二 ...
- appium简明教程(10)——控件定位基础
狭义上讲,UI级的自动化测试就是让机器代替人去点来点去的过程. 但机器去点什么(点上面还是点左边),怎么点(是长按还是轻触),这些东西是必须由代码的编写者所指示清楚的. 控件定位就是解决机器点什么的问 ...
- appium简明教程(9)——如何获取android app的Activity
有时候在appium的Desired Capabilities中需要指定被测app的appActivity,下面的方法可能会对你有所帮助. 方法一 如有你有待测项目的源码,那么直接查看源码就好.如果没 ...
- appium简明教程(8)——那些工具
那片笑声让我想起我的那些tool 在我生命每个角落静静为我开着 我曾以为我会永远守在她身旁 今天我们已经离去在人海茫茫 她们都老了吧 都更新换代了吧 幸运的是我曾陪她们开发 啦…… 想她 啦…… 她还 ...
随机推荐
- Android Studio打开出现:Default activity not found
昨天项目可以正常打开,没有问题,今天打开的时候就出现了这个问题.可以编译,但是无法生成APK调试.当然,如果选择 Do not launch Activity就可以成功编译.出现这个 Default ...
- 使用jstl报http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar错误
今天创建了一个maven项目,想使用jstl报http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the ...
- javascript设计思维
//一.把参数当作私有变量使用 (function (a, b) { //把参数当作私有变量使用,省略了var,也节省了行数 console.log(b) //undefined,所有未赋值的变量均为 ...
- Win7安装golang开发环境--备忘录
首次接触golang,非常多东西不熟悉,Git也没有安装. 1 安装golang 1.1 下载golang 我是在Golang中国的下载频道下载的golang1.6.链接例如以下: http://ww ...
- 安装了XAMPP,PHP怎么显示中文
1.输出前加文件头.header("Content-type: text/html; charset=utf-8"); 另外注意你的文件编码要和 charset一致. 2. 可能是 ...
- 图像检索:RGBHistogram+欧几里得距离|卡方距离
RGBHistogram: 分别计算把彩色图像的三个通道R.G.B的一维直方图,然后把这三个通道的颜色直方图结合起来,就是颜色的描写叙述子RGBHistogram. 以下给出计算RGBHistogra ...
- createjs入门
createjs是一个轻量级的框架,稍微有点时间和耐心,就可以把全部源代码都看一遍,毕竟只有三十几个js文件.地址:http://www.createjs.com/ 开发createjs的动画或游戏, ...
- Android 百度地图开发(一)
在自己的Android项目中增加百度地图的功能. 一 申请API key 在使用百度地图之前,我们必须去申请一个百度地图的API key,申请地址http://lbsyun.baidu.com/api ...
- 〖Android〗Android源代码所有目录生成的Target(编译生成文件反查)
=> build/tools/zipalign: out/host/linux-x86/bin/zipalign (host) => build/tools/atree: out/host ...
- 【Linux】Ubuntu13.10 设置静态ip地址
vim /etc/network/interfaces # interfaces() ) and ifdown() auto eth0 iface eth0 inet static address 2 ...