Testng中的测试方法和测试标签有什么区别 [英] What is the difference between test method and test tag inTestng

查看:25
本文介绍了Testng中的测试方法和测试标签有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在使用 TestNG 有一段时间了,但我仍然不知道这两个的预期目的是什么(@Test 在套件中.xml) 以及它们要表达的抽象.

I'm using TestNG for some time now but still I don't know what's the intended purpose of those two (@Test and < test> in suite.xml)and what abstractions they are meant to express.

另外,如果有人可以分享他们在 TestNG 中其他元素的行为差异.例如 @AfterTest @BeforeTest@Test 触发,>@Test 进入最终执行报告.

Also if anyone can share the difference in their behavior regarding other elements in TestNG. For example are @AfterTest @BeforeTest triggered by @Test or <test> and which one of @Test and < test> gets into the final execution report.

推荐答案

@Test 表示测试方法.<test> 是您在 testng.xml 中将多个类组合在一起的方式.

@Test denotes a test method. <test> is a how you group several classes together in your testng.xml.

这篇关于Testng中的测试方法和测试标签有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆