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 S开发者_运维知识库uite? Can anybody please provide me some example coding?
Why not start at the source? The TestNG documentation on their site
http://testng.org/doc/documentation-main.html
In TestNG suite
is the highest level of grouping tests. It is defined by the single XML file. It can include test
constructs (which are different from specific tests you will implement), groups
, classes
, and methods
. 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:
- Definitely, start at the documentation section of TestNG website. They provide some code samples in Java.
- If you can get hold of the book Next Generation Java Testing, this would be a good resource to continue. Also have illustrations of discussed functionality in Java.
- You need to understand testing fundamentals, to see how TestNG uses them:
- Software testing
- Test plan
- Test case
- Test suite
- Unit testing
- Integration testing
- Look at some other unit tests frameworks and tutorials. The simplest would be JUnit, which is where most of TestNG came from (at least according to the book).
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.
精彩评论