TestNG Learning -001-Basic theory knowledge

Source: Internet
Author: User
Tags testng

This paper mainly describes the basic theoretical knowledge of TestNG, TestNG the specific, writing the test process three steps, and junit4+ differences, so that the pro-TestNG test framework can have a simple cognition.

Hope to be able to beginners TestNG test framework of the pro-helpful. If there is any deficiency, please ask the great God to correct me, I appreciate it!

what is testng?


testng features

    1. testng uses Java object-oriented features
    2. support for comprehensive class testing (for example, By default, there is no need to create a new instance of the class that tests each test method)
    3. flexible runtime configuration
    4. main introduction to "test Group". When compiling the test, just ask TestNG to run all the "front-end" tests, or "fast", "slow", "database", etc.
    5. support for dependent test methods, parallel tests, load tests, local failures
    6. flexible plug-in API
    7. multi-threaded test

TestNG write the test process in three steps:

    1. Write the business logic for the test and insert the testng in the code annotation
    2. Add test information to the Testng.xml file or to the Pom.xml file
    3. Run TestNG


The difference between TestNG and junit4+

    1. The design goals are different. TestNG is an open-source test framework designed to simplify a wide range of test requirements, not only for unit testing, but also for integration testing, compared to JUnit's only fit for unit testing, TestNG no doubt goes further.
    2. The test process is different. TestNG and junit4+, more than a test information added to testng.xml files or pom.xml files, test information, especially the test data is no longer written dead in the test code, the advantage is to modify the test data without the need to modify the code/compile, Helps bring testers into unit test/integration testing.
    3. Whether the use case can be relied upon. The dependencies between test cases are provided in TestNG, and JUnit is a separate individual for each test force and cannot be tested for dependencies between use cases

At this point,TestNG learning -001-Basic theory of Knowledge , hope this article can give a preliminary knowledge TestNG test framework of your reference.

Finally, very grateful to the pro-stop, I hope this article can be pro helpful. Warmly welcome the kiss to discuss together and progress together. Thank you so much! ^_^

TestNG Learning -001-Basic theory knowledge

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.