![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
testNG
马丁•路德•王
此人不是很懒,但是不想写
展开
-
TestNG和Junit5测试框架梳理
注解来参数化执行不同的测试用例,每次测试会使用不同的参数进行运行。则是一种更为动态和灵活的方式,它允许你在运行时生成测试用例。TestFactory其实就是参数化执行同一条用例。创建一个Yaml文件testdata.yaml。通常情况下,我们会使用。6. testNG断言。原创 2023-08-09 20:01:53 · 1905 阅读 · 0 评论 -
testng中并行执行的类型及方法
1.在xml中设置<suite name="threadSuite" parallel="methods" thread-count="3">其中parallel字段有"methods","classes","tests","instances""methods"->分别对应方法级,所有方法一起执行"classes"->此并发方式需要将xml中的suite标签内的属性parallel属性设置为classes,且添加属性thread-count并设置其值即可实现cla原创 2021-08-02 01:05:43 · 252 阅读 · 0 评论 -
testNG中BeforeSuite,BeforeClass,BeforeMethod,Test执行顺序
今天重新整理了一下执行顺序:After和Before都能对应起来总结:BeforeSuite ->BeforeTest->BeforeClass->BeforeMethod->Test1package wechat.wechatTest;import org.testng.annotations.*;public class mumu { @BeforeSuite public void Suite(){ Sys...原创 2021-07-05 00:06:13 · 1427 阅读 · 0 评论 -
TESTNG中的并发测试invocationCount, threadPoolSize, timeOut的使用
在testng注解中使用以下注解达到并发测试的目的,例如秒杀等:invocationCount----表示执行的次数threadPoolSize-----表示线程池的内线程的个数timeOut-------超时时间-毫秒代码:import org.testng.annotations.Test;public class mumu { private static int i = 0; @Test(threadPoolSize = 1, invocationCoun原创 2021-07-04 23:37:45 · 682 阅读 · 0 评论