TestNG注释@BeforeGroups与@AfterGroups不执行的处理
2024-10-20 08:24:54
在学习TestNG框架注解时发现在执行以下的代码
package com.groups;
import org.testng.annotations.AfterGroups;
import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;
public class GroupOnMethod {
@Test(groups = "1")
public void test1(){
System.out.println("测试1");
}
@BeforeGroups("1")
public void BeforeGroup(){
System.out.println("1之前");
}
@AfterGroups("1")
public void AfterGroup(){
System.out.println("1之后");
}
}
出现的结果会是只打印出:
测试1
问题的处理:经过交流沟通发现使用的环境有差异,这段代码在TestNG版本为6.11正常会执行全部的,但在版本7.1.0出现了上述的情况,后来更换版本成功解决此问题
大家可以再7以上的其他版本试试有没此现象大出现,6的版本的应该是都正常的
最新文章
- Unity 3D学习之《Unity 3D 手机游戏开发》1
- 【leedcode】 Median of Two Sorted Arrays
- 解析json
- PyQt类库介绍
- The web application [/codeMarket] registered the JBDC driver[.........] but failed to unregister it when the web application was stopped. To prevent
- 测试Swift语言代码高亮-使用highlight.js
- 4.python中的用户交互
- 在后台直接调用sql
- Asp.Net Core(.net内核)
- html 文件动态加载.PDI 流程图
- java 值传递和引用传递。
- apply()
- Scrum Meeting 合集
- python学习笔记----正则表达式
- MySQL中间件之ProxySQL(9):ProxySQL的查询缓存功能
- Javaweb学习笔记——(十三)——————JSTL、JSTL核心标签库、自定义标签、有标签体的标签、带有属性的标签、MVC、Javaweb三层框架
- Redis高级特性介绍及实例分析
- pandas模块安装问题笔记
- POJ 3468 A Simple Problem with Integers(线段树模板之区间增减更新 区间求和查询)
- TensorFlow基础笔记(4) Tensor Transformation