testNG之顺序执行
import org.testng.annotations.Test;
public class testNG1 {
@Test
public void testNg() {
System.out.println("this is testNG1");
}
}
import org.testng.annotations.Test;
public class testNG2 {
@Test
public void testNg() {
System.out.println("this is testNG2");
}
}
import org.testng.annotations.Test;
public class testNG3 {
@Test
public void testNg() {
System.out.println("this is testNG3");
}
}
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name="Suite1" verbose="1" >
<test name="Regression1" >
<classes>
<class name="testNG2" />
<class name="testNG1" />
<class name="testNG3" />
</classes>
</test>
</suite>
this is testNG1
this is testNG2
this is testNG3
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name="Suite1" verbose="1" >
<test name="Regression1" preserve-order="true" >
<classes>
<class name="testNG2" />
<class name="testNG1" />
<class name="testNG3" />
</classes>
</test>
</suite>
this is testNG2
this is testNG1
this is testNG3
import org.testng.annotations.Test;
public class testNG4 {
@Test
public void testNgMethond1() {
System.out.println("this is testNgMethond1");
}
@Test
public void testNgMethond2() {
System.out.println("this is testNgMethond2");
}
@Test
public void testNgMethond3() {
System.out.println("this is testNgMethond3");
}
}
testng.xml:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name="Suite1" verbose="1" >
<test name="Regression1">
<classes>
<class name="testNG4" />
<methods>
<include name="testNgMethond3"></include>
<include name="testNgMethond2"></include>
<include name="testNgMethond1"></include>
</methods>
</classes>
</test>
</suite>
this is testNgMethond1
this is testNgMethond2
this is testNgMethond3
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name="Suite1" verbose="1" >
<test name="Regression1" preserve-order="true">
<classes>
<class name="testNG4" />
<methods>
<include name="testNgMethond3"></include>
<include name="testNgMethond2"></include>
<include name="testNgMethond1"></include>
</methods>
</classes>
</test>
</suite>
再次运行testng.xml,执行结果:
this is testNgMethond3
this is testNgMethond2
this is testNgMethond1
testNG之顺序执行的更多相关文章
- testng.xml顺序执行多个case配置
testng.xml顺序执行多个case配置 项目结构如图:
- 使用TestNG框架测试用例执行顺序问题
既然是讨论执行顺序问题,那么用例肯定是批量执行的,批量执行的方法有mvn test.直接运行testng.xml文件,其中直接运行testng.xml文件的效果与pom文件中配置执行testng.xm ...
- testng xml中按顺序执行java类
如红字部份,将安顺序执行4个类 <?xml version="1.0" encoding="UTF-8"?><suite name=" ...
- js的并行加载以及顺序执行
重新温习了下这段内容,发现各个浏览器的兼容性真的是搞大了头,处理起来很是麻烦. 现在现总结下并行加载多个js的方法: 1,对于动态createElement('script')的方式,对所有浏览器都是 ...
- 【原创】cs+html+js+css模式(七): 顺序执行与并发执行问题,IIS7及其以上版本的抛错问题解决
在进行开发的过程中,针对于这种模式,我们继承的IRequiresSessionState,这种对于我们的同一个IIS的执行中是顺序执行即一个ajax请求处理完成后,才能执行下一个ajax, ...
- js的并行加载与顺序执行
javaScript文件(下面简称脚本文件)需要被HTML文件引用才能在浏览器中运行.在HTML文件中可以通过不同的方式来引用脚本文件,我们需要关注的是,这些方式的具体实现和这些方式可能会带来的性能问 ...
- gulp顺序执行任务
gulp的任务的执行是异步的. 所以,当我写完一系列的任务,准备一股脑地执行. # gulp.task('prod', ['clean', 'compass', 'image', 'style', ' ...
- 顺序执行到来的消息 actor
在某项目里,有个 actor 需要做一些持久化的操作,这些操作耗时比较久,理应使用异步的代码来写,但是需求又强调每次只能做一个持久化操作,后来的请求应该等待.一个显然的做法是阻塞式的写,这样就能比较简 ...
- 多命令顺序执行、管道符 ; && || |
多命令顺序执行:
随机推荐
- 【BZOJ1396】识别子串(后缀自动机,线段树)
题意: 一行,一个由小写字母组成的字符串S,长度不超过10^5 思路:论文题 设p为自动机上的合法结点,r为右端点,len=st[fa[p]]]+1 位置[r-st[p]+1,r-len+1]与r-i ...
- AcWing 248. 窗内的星星 (扫描线)打卡
题目:https://www.acwing.com/problem/content/250/ 题意:给你n个点,现在问你能每个点都有个权值,问你能覆盖最多的权值是多少,边界不算 思路:这个其实和我之前 ...
- 2018-2019-2 《Java程序设计》第10周学习总结
20175319 2018-2019-2 <Java程序设计>第10周学习总结 教材学习内容总结 本周学习<Java程序设计>第十二章java多线程机制: - 进程与线程 程序 ...
- mysql捕捉所有SQL语句
MySQL可以通过开通general_log参数(可动态修改)来扑捉所有在数据库执行的SQL语句.显示参数:mysql> show variables like 'general%log%';+ ...
- GPIO 的 8 种工作模式
GPIO 的 8 种工作模式 在初始化 GPIO 的时候,根据我们的使用要求,必须把 GPIO 设置为相应的模式.如 LED 例程中的 GPIO 引脚如果配置为模拟输入模式是必然会导致错误的. 我们配 ...
- jmeter添加自定义扩展函数之if判断
1,打开eclipse,新建maven工程,在pom中引用jmeter核心jar包,具体请看---https://www.cnblogs.com/guanyf/p/10863033.html---,这 ...
- Weblgic安装应用报错:Caused by: com.bea.xml.XmlException: failed to load java type corresponding to e=web-a
文章目录 报错如下 解决: 报错如下 Exception in AppMerge flows' progression 后台日志报错: Caused by: com.bea.xml.XmlExcept ...
- js 使用技巧
一,获取客户端状态 1.获取cookie function cookieInfo() { setcookie('cookie_test','1'); var cookie_test = getcook ...
- selenium和phantomjs,完成豆瓣音乐排行榜的内容爬取
代码要多敲 注释要清晰 哪怕再简单 #使用selenium和phantomjs,完成豆瓣音乐排行榜的内容爬取 #地址:https://music.douban.com/chart #导入需要的模块 f ...
- 实验报告(五)&第七周学习总结
实验目的 理解抽象类与接口的使用: 了解包的作用,掌握包的设计方法. 实验要求 掌握使用抽象类的方法. 掌握使用系统接口的技术和创建自定义接口的方法. 了解 Java 系统包的结构. 掌握创建自定义包 ...