TestNG简单介绍以及安装—学习笔记1
TestNG是什么
到这里,大家肯定已经运行了一些关于Selenium的测试用例了(这里主要是站着一个自动化测试工程师的角度来看待TestNG的,所以这里所说的也都是基于Web测试的验证点来说的,而不是针对单元测试来说。这里就涉及到了Selenium),也产生了相应的格式的测试输出结果了。现在我们将学习一下怎样利用TestNG这个测试框架将测试结果报告显示出来。
TestNG和Junit一样都是一种测试框架,不过它克服了Junit存在的一些局限性。NG意味着"Next Generation".大部分的Selenium测试工程师都选择TestNG而非Junit就是因为TestNG的优势。在TestNG中出现了更多的功能相对于Junit来说,但是在这里我们只关注在Selenium测试中应用比较多的功能。
TestNG VS Junit
TestNG相对于JUnit有三点主要的优势:
- 注释更容易理解
- 测试用例能以组的概念出现会显得更简单
- 并行测试成为可能
Installing TestNG in Eclipse
步骤1
- Launch Eclipse.
- On the menu bar, click Help.
- Choose the "Install New Software..." option.

Step 2
In the Install dialog box, click the Add button

Step 3
- In "Name", type TestNG.
- In "Location", type http://beust.com/eclipse.
- Click OK

Step 4
- Notice that "TestNG - http://beust.com/eclipse" was populated onto the "Work with:" textbox.
- Check the "TestNG" check box as shown below, then click Next.
- Note: In the latest Eclipse (Kepler) you don't have a checkbox for testNG, instead you click on question mark (help) icon which will open up the form, and you can select all and installation will continue as for the remaining instructions. Thanks Jana for the tip!

Step 5
- Click Next again on the succeeding dialog box until you reach the License Agreement dialog.
- Click "I accept the terms of the license agreement" then click Finish.

Step 6
Wait for the installation to finish

If you encounter a Security warning, just click OK

Step 7
When Eclipse prompts you for a restart, just click Yes.

Step 8
After restart, verify if TestNG was indeed successfully installed. Click Window > Preferences and see if TestNG is included on the Preferences list.

Step9
We will now start to import the TestNG Libraries onto our project. Click on the "Libraries" tab, and then "Add Library…"

Step 10
On the Add Library dialog, choose "TestNG" and click Next.

Step 11
Click Finish.

You should notice that TestNG is included on the Libraries list.

Step 12
We will now add the JAR files that contain the Selenium API. These files are found in the Java client driver that we downloaded from http://docs.seleniumhq.org/download/ when we were installing Selenium and Eclipse in the previous chapters.

TestNG简单介绍以及安装—学习笔记1的更多相关文章
- 路由其实也可以很简单-------Asp.net WebAPI学习笔记(一) ASP.NET WebApi技术从入门到实战演练 C#面向服务WebService从入门到精通 DataTable与List<T>相互转换
路由其实也可以很简单-------Asp.net WebAPI学习笔记(一) MVC也好,WebAPI也好,据我所知,有部分人是因为复杂的路由,而不想去学的.曾经见过一位程序猿,在他MVC程序中, ...
- Linux系统Vi/Vim编辑器的简单介绍、安装/卸载、常用命令
Linux系统Vi/Vim编辑器的简单介绍.安装/卸载.常用命令 1.介绍 vi(Visual Interface)编辑器是Linux和Unix上最基本的文本编辑器,工作在字符模式下.由于不需要图形界 ...
- CocoaPods的简单介绍及安装和使用
CocoaPods的简单介绍及安装和使用 一.CocoaPods是什么? 当你开发iOS应用时,会常常使用到非常多第三方开源类库.比方JSONKit.AFNetWorking等等. 可能某个类库又 ...
- openresty开发系列10--openresty的简单介绍及安装
openresty开发系列10--openresty的简单介绍及安装 一.Nginx优点 十几年前,互联网没有这么火,软件外包开发,信息化建设,帮助企业做无纸化办公,收银系统,工厂erp,c/s架构偏 ...
- Nessus简单介绍与安装
1.Nessus简单介绍与安装 1.Nessus简介 Nessus号称是世界上最流行的漏洞扫描程序,全世界有超过75000个组织在使用它.该工具提供完整的电脑漏洞扫描服务,并随时更新其漏洞数据库.Ne ...
- Mahout学习之Mahout简单介绍、安装、配置、入门程序測试
一.Mahout简单介绍 查了Mahout的中文意思--驭象的人,再看看Mahout的logo,好吧,想和小黄象happy地玩耍,得顺便陪陪这位驭象人耍耍了... 附logo: (就是他,骑在象头上的 ...
- MongoDB(1)--简单介绍以及安装
前段时间接触了NoSql类型的数据库redis,当时是作为缓存server使用的.那么从这篇博客開始学习还有一个非常出名的NoSql数据库:MongoDb.只是眼下还没有在开发其中使用.一步一步来吧. ...
- Kurento应用开发指南(以Kurento 5.0为模板) 之中的一个:简单介绍,安装与卸载
文件夹 1. Kurento是什么 3 2. Kurento简单介绍 3 2.1 WebRTC媒体server ...
- Cloudera impala简单介绍及安装具体解释
一.Impala简单介绍 Cloudera Impala对你存储在Apache Hadoop在HDFS,HBase的数据提供直接查询互动的SQL.除了像Hive使用同样的统一存储平台,Impala也使 ...
随机推荐
- php api接口安全设计 sign理论
一. url请求的参数包括:timestamp,token, username,sign 1. timestamp: 时间戮 2. token: 登陆验证时,验证成功后,生成唯一的token(可以为u ...
- java通过http服务执行shell命令
服务端代码/** * 执行shell命令 * @param command 执行命令 * @return */public String exeCommandByPath( String comman ...
- error occurred at recursive SQL level 1
ORA-00604: error occurred at recursive SQL level 1出现的错误:java.sql.SQLException: ORA-00604: error occu ...
- asdm不能登录问题;浏览器必须是ie,不能是chrome或者firefox;java的版本,尤其是安全等级和例外需要调整
asdm不能登录问题:浏览器必须是ie,不能是chrome或者firefox;java的版本,尤其是安全等级和例外需要调整
- WorldWind源码剖析系列:四叉树瓦片集合类QuadTileSet
四叉树瓦片集合类QuadTileSet是影像瓦片渲染的主要类.使用地形管理器来为3D地形渲染查询高程值.依赖于用来刷新基于经度.纬度.视角范围瓦片的更新线程.该类继承自可渲染对象类Renderable ...
- OpenCV——Harr特征
- Jredis的使用范例
简单使用 public class JedisTest { private static final Logger LOGGER = LoggerFactory.getLogger(JedisTest ...
- linux中分区、格式化文件系统、挂载
以前学linux的时候,毕竟自己没搞运维,就只注重了很多命令的运用,没太在意文件系统这块.买了本linux的书,这部分看了点东西,记个笔记哈哈. 有个场景,比如说我们现在的服务器上存储不够用了,那么当 ...
- 电信3G上网卡自己主动重拨
须要使用电信3G无线上网卡做一个測试,由于要长时间使用,在使用的过程中老掉线,所以做了一个自己主动重连的批处理,好了,闲话少叙,开工: 先建立一个拨号连接: 001.png watermark/2/t ...
- hdu 1505 City Game (hdu1506加强版)
# include <stdio.h> # include <algorithm> # include <string.h> # include <iostr ...