使用 TestNG
我正在自动化测试环境中担任实习生。 我必须了解 TestNG 和 TestNG 的一些示例。测试套件是什么意思?有人可以给我提供一些示例编码吗?
I am working as a trainee in Automated Testing Environment.
I have to know about TestNG and some examples of TestNG. What is meant by Test Suite? Can anybody please provide me some example coding?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为什么不从源头开始呢?其网站上的 TestNG 文档
http://testng.org/doc/documentation-main.html
Why not start at the source? The TestNG documentation on their site
http://testng.org/doc/documentation-main.html
在 TestNG 中,
suite
是分组测试的最高级别。它由单个 XML 文件 定义。它可以包含test
构造(与您将实现的特定测试不同)、groups
、classes
和methods
>。要更好地了解所有这些元素如何相关,请查看 5 - 测试方法、测试类和测试< /a> 文档的组部分。要了解 testng.xml 中如何定义
,请查看 此文件的 DTD。下面请找到一些建议,可以帮助您更好地理解 TestNG 和单元测试:
In TestNG
suite
is the highest level of grouping tests. It is defined by the single XML file. It can includetest
constructs (which are different from specific tests you will implement),groups
,classes
, andmethods
. To understand better how all these elements are related look into 5 - Test methods, Test classes and Test groups section of documentation. To understand how<suite>
is defined in testng.xml, check out DTD for this file.Below please find some recommendations that can help you better understand TestNG and unit testing in general:
测试套件是测试用例的驱动类。如果你有很多具有多种测试方法的测试用例类,测试套件类或suite.xml可以一一调用每个测试类。
Test suite is the driving class of test cases. if you have many testcase classes with the multiple test methods, test suite class or suite.xml can call each of the test class one by one.