TestNG 并发参数一览
来源:互联网 发布:不愉快的怪物庵 知乎 编辑:程序博客网 时间:2024/05/01 12:05
TestNG支持多种方式的并发测试,官方文档并没有对所有的参数进行系统说明,本文对TestNG并发参数进行梳理,以期对TestNG并发测试功能获得全面的认识。
testng.xml配置文件中的参数
suite tag级别参数
parallel (false | methods | tests | classes | instances) “false”
thread-count CDATA “5”
data-provider-thread-count CDATA “10”
- parallel
在suite tag级别指定TestNG并发的粒度,支持false,methods,tests,classes,instances。默认是false不并发。- thread-count
并发的线程数,默认是5个线程。- data-provider-thread-count
指定以DataProvider传入参数的测试方法的并发线程数,默认是10个。
test tag级别参数
parallel CDATA #IMPLIED
thread-count CDATA #IMPLIED
- parallel
在test tag级别指定并发的级别,与suite tag级别的取值范围一样,如果指定覆盖suite tag级别的参数值。- thread-count
在test tag级别指定并发的线程数,与suite tag级别的取值范围一样,如果指定覆盖suite tag级别的取值。
class tag级别
无
源代码中指定的参数
@Test annotation的参数
threadPoolSize
invocationCount这两个@Test annotation的参数是在一起使用的,可以指定某个测试方法的并发数和总运行次数。
1. threadPoolSize
测试方法并发线程池的大小,也是并发线程的个数。
2. invocationCount
总调用次数,会以threadPoolSize指定的线程数并发运行invocationCount次。
@DataProvider annocation的参数
parallel (true|false)
- parallel
如果指定为true,DataProvider中的数据会以并发的方式读取,并驱动相应测试方法并发执行。
TestNG命令行参数
有三个参数,如下所示
Option Argument Documentation -dataproviderthreadcount The default number of threads to use for data providers when running tests in parallel. This sets the default maximum number of threads to use for data providers when running tests in parallel. It will only take effect if the parallel mode has been selected (for example, with the -parallel option). This can be overridden in the suite definition. -parallel methods tests -threadcount The default number of threads to use when running tests in parallel. This sets the default maximum number of threads to use for running tests in parallel. It will only take effect if the parallel mode has been selected (for example, with the -parallel option). This can be overridden in the suite definition.
基本上就是suite tag级别参数的命令行形式,会被testng.xml配置文件中的值覆盖。
1 0
- TestNG 并发参数一览
- TestNG 八 并发测试
- testNG进行并发编程
- Testng并发测试
- testng参数化测试
- TestNG 参数化测试
- testng参数化学习
- TestNG参数传递方法
- TestNG·八 并发测试
- 简单聊聊TestNG中的并发
- 简单聊聊TestNG中的并发
- 简单聊聊TestNG中的并发
- 简单聊聊TestNG中的并发
- 简单聊聊TestNG中的并发
- window.open参数一览
- iframe的参数一览
- window.open参数一览
- iframe的参数一览
- 小熊android学习总结:Linux内核怎样启动Android
- 字节序
- IOS中Key-Value Coding (KVC)的使用列举
- 百度自动更新SDK的使用
- fread 读取文件问题
- TestNG 并发参数一览
- 微信移动社交用户心流体验对用户粘性的影响研究
- “ sgen.exe ”已退出,代码为 1
- Lift第一篇:Lift环境搭建
- UDP 广播发包失败
- soj 2505: The County Fair(离散化 + 记忆化搜索)
- Spring、Bean 的作用域
- QQ是如何监控你的聊天记录的
- java nio原理和它的优点