mvn test 执行testng测试用例
maven项目,把testng用例防止test目录下,配置pom.xml 文件如下,执行mvn test 能自动执行testng里面的用例
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <groupId>com.test</groupId>
<artifactId>mvntestng</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging> <name>mvntestng</name>
<url>http://maven.apache.org</url> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> <dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.13.6</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<suiteXmlFiles>
<file>testng.xml</file>
<file>testng2.xml</file>
</suiteXmlFiles>
<properties>
<property>
<name>suitethreadpoolsize</name>
<value>2</value>
</property>
</properties>
</configuration>
</plugin>
</plugins>
</build>
</project>
执行结果

mvn test 执行testng测试用例的更多相关文章
- Ant学习-002-ant 执行 TestNG 测试用例时 [testng] java.lang.NoClassDefFoundError: com/beust/jcommander/ParameterException 解决方案
上篇文章中概述了 Ant windows 环境的基本配置,此文讲述在初次使用的过程中遇到的问题. 今天通过 ant 执行 TestNG 测试用例时,执行报错,相应的错误信息如下所示: Buildfil ...
- TestNG入门教程-12-Java代码执行testng.xml和失败后重跑
前面我们都在IDEA上右键testng.xml文件来运行testng用例,这个在编写测试用例过程是 可以这么做,但是,如果测试用例写完了,也是这么做吗?有没有什么方法,例如自动化去实现.测试脚本维护后 ...
- 通过代码来执行testng.xml
大多数时候,我们都是通过Eclipse IDE上的操作命令来执行testng 框架下的case 运行.那如果我们不想通过这种方式,而是想通过代码调用来实现执行该怎么办?下面是我搜集的两种方式供大家参考 ...
- python3的unittest中使用test suite(测试套件)执行指定测试用例
示例代码 module.py class baidumodule(): def __init__(self,driver,): self.dr = driver #不能在类中再次导入webdriver ...
- postman系列之批量执行接口测试用例
postman如何批量执行接口测试用例~其实很简单,但是会给我们的工作带来很多方便~ 比如我们写了几十个测试用例,请求都是同一个服务器IP,一旦服务器IP地址从测试环境搬到线上环境,需要修改所有的服务 ...
- Mac idea 执行testng用例,提示%MODULE_WORKING_DIR%目录不存在解决办法
idea 下载git代码 执行testng用例,报错: 下午4:47 Error running 'Test.apkStart': Cannot start process, the working ...
- postman(一)批量执行接口测试用例
postman(一)批量执行接口测试用例 学习了:https://blog.csdn.net/github_36032947/article/details/78611405 还可以把collecti ...
- 代码执行testng的几种方式
一.指定test class Test class FirstTest package cas.eric; import org.testng.annotations.Optional; import ...
- 测者的测试技术手册:Junit执行单元测试用例成功,mvn test却失败的问题和解决方法
今天遇见了一个奇怪的问题,在IDE中run unit test,全部cases都成功了,但是后来通过mvn test运行case确保错了.在寻求原因的同时也找到了对应的解决方法. Run Unit T ...
随机推荐
- 如何配置Ubuntu 16.04 GRUB 2引导加载程序
正如你所知,GRUB 2 是大多数 Linux 操作系统的默认引导加载程序.GRUB 是 GRand Unified Bootloader 的缩写,它是 Linux 启动时首先要加载的一个程序,此后它 ...
- RS错误RSV-VAL-0032之项目未在布局中引用的3种解决办法
如下图所示,我用RS新建了一个空白页面,拖入了一个列表,给该列表新建了一个条件样式 条件样式如下所示,表达式来自查询1 运行,报错如下图所示 原因就是条件样式使用到了查询1中的数据项1但是数据项1在报 ...
- mongo文本搜索的一个例子
假如有一个名为articles的集合,数据如下: { "_id" : 1, "title" : "cakes and ale" } { ...
- GeSHi——通用语法高亮显示
Examples Category Examples Views ActionScript 2 46173 Ada 3 27881 Apache configuration 2 40029 Apple ...
- linux more 上一页,下一页
linux more 上一页,下一页 使用more命令可以分页查看内容: 如: more install.txt 分页查看文本内容: 按回车:默认下一行数据: 按空格键盘,默认下一页,以当前屏幕为单位 ...
- HTML5 精灵8方向移动+背景滚动+音效播放+鼠标事件响应
如何清空画布 通过调用函数 ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); 如何实现背景滚动 首先我们准备了一张2532*940 ...
- 本地文件夹变远程仓库并且提交Github
//初始化本地仓库 $ git init Initialized empty Git repository in C:/Users/root/Desktop/vue-music/.git/ root@ ...
- Oracle体系结构一(学习笔记)
总体结构分为三个部分:SGA,PGA,FILE文件 按功能分: 存储结构 存储结构对应关系 主要文件: 数据文件: 每个数据文件只与一个数据库相关联 一个表空间可以包含一个或者多个数据文件 一个数 ...
- 栈的应用实例——平衡符号
检查().[].{}是否配对. /* stack_balance_symbol */ #include "stack.h" #include <stdio.h> #in ...
- [转]查看linux服务器硬盘IO读写负载
最近一台linux服务器出现异常,系统反映很慢,相应的应用程序也无法反映,而且还出现死机的情况,经过几天的观察了解,发现服务器压力很大,主要的压力来自硬盘的IO访问已经达到100% 为了方便各位和自己 ...