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 需要做一些持久化的操作,这些操作耗时比较久,理应使用异步的代码来写,但是需求又强调每次只能做一个持久化操作,后来的请求应该等待.一个显然的做法是阻塞式的写,这样就能比较简 ...
- 多命令顺序执行、管道符 ; && || |
多命令顺序执行:
随机推荐
- SpringBoot JSON文件读取
@Componentpublic class StepExecutor implements Runnable { @Value("classpath:menu.json") pr ...
- 配置 Ceph 内外网分离
https://www.jianshu.com/p/42ab1f6dc6de 1. 为什么要做内外网分离 先明确一下这么做的必要性.Ceph 的客户端,如 RADOSGW,RBD 等,会直接和 O ...
- JS中的立即执行函数
JS 立即执行函数可以让函数在创建后立即执行,这种模式本质上就是函数表达式(命名的或者匿名的),在创建后立即执行. 1.立即执行函数的写法 立即执行函数通常有下面两种写法: //第一种写法 (func ...
- 【Dart学习】--之Iterable相关方法总结
一,概述 按顺序访问的值或元素的集合, List集合也是继承于Iterable List和Set也是Iterable,dart:collection库中同样有很多 部分Iterable集合可以被修改 ...
- Android中实现Activity的启动拦截之----实现360卫士的安装应用界面
第一.摘要 今天不是周末,但是我已经放假了,所以就开始我们的技术探索之旅,今天我们来讲一下Android中最期待的技术,就是拦截Activity的启动,其实我在去年的时候,就像实现这个技术了,但是因为 ...
- java并发编程笔记(十)——HashMap与ConcurrentHashMap
java并发编程笔记(十)--HashMap与ConcurrentHashMap HashMap参数 有两个参数影响他的性能 初始容量(默认为16) 加载因子(默认是0.75) HashMap寻址方式 ...
- idea中以maven工程的方式运行tomcat源码
0. 准备环境 idea+jdk8+tomcat源码 1.下载tomcat源码: http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/ ...
- npm run mock | npm run dev只能启动一个
解决方法: 开两个命令窗口 先运行npm run mock 再运行npm run dev
- linux下的命令是如何运行的
linux下的命令分为内建命令.可执行文件.脚本文件 shell终端里键入一个命令,如ls.cd.bash,shell会先查询一个环境变量PATH,它存了各种可执行文件的路径,输入$PATH可以打印变 ...
- Java + selenium 元素定位(1)之By id/Name/ClassName
这篇文章开始,要介绍web自动化核心的内容,也是最困难的部分了,就是定位元素,并去对元素进行操作.想要对元素进行操作,第一步,也是最重要的一步,就是要找到这个元素,如果连元素都定位不到,后续什么操作都 ...