TestNG Basic- Part I

1. What is TestNG ? 

TestNG is a testing framework which, inspired by JUnit and NUnit, but introducing many new innovative functionality like dependency testing, grouping concept to make testing more powerful and easier to do. It is designed to cover all categories of tests: unit, functional, end-to-end, integration, etc.

TestNG is an open source automated testing framework; where NG of TestNG means Next Generation. TestNG is similar to JUnit (especially JUnit 4), but its not a JUnit extension. Its inspired by JUnit. It is designed to be better than JUnit, especially when testing integrated classes. The creator of TestNG isCedric Beust.

TestNG eliminates most of the limitations of the older framework and gives the developer the ability to write more flexible and powerful tests. As it heavily borrows from Java Annotations (introduced with JDK 5.0) to define tests, it can also show you how to use this new feature of the Java language in a real production environment.
2. What are the main features of the TestNG 

a) Annotations
b) Support for data-driven testing (with @DataProvider)
c) Support for parameters.
d) TestNG uses better Java and Object Oriented features.
e) TestNG has flexible runtime configuration.
f) Supports testing integrated classes. It does not need to create a new test class instance for every test method.
g) Support for multi-threaded testing.
h) Default JDK functions for runtime and logging.
i) Flexible execution model.

j) Supported by variety of tools and plug-ins like Eclipse, Maven, Intellij’s IDEA, NetBeans etc.
k)TestNG has feature of test groups. We can just guide TestNG to run all of our test in different combined groups.


3. What are the advantages of TestNG over JUnit ?

a) In TestNG, there is no method name constraint as in JUnit. We can give any name to the test methods in TestNG.
b) In JUnit, we have to declare @BeforeClass and @AfterClass but in TestNG this is not necessary. 

c) In TestNG we can tell the test that one method is dependent on another method but in JUnit it is not possible. In JUnit each test is independent of each other.
d) We can group the test cases in TestNG which is not possible in JUnit.
e) TestNG support various kind of annotations like @BeforeSuite, @AfterSuite, @BeforeTest, @AfterTest, @BeforeGroup, @AfterGroup etc. 

TestNG is a framework for Java, so the very first requirement is to have JDK installed in our system.

TestNG has following Minimum System Requirement: 

a) JDK- 1.5 or above
b) Memory- Not specifically defined.

c) Disk Space- Not specifically defined.
d) Operating System- Windows, Mac, Linux



For working TestNG on our system, follow these steps: 

a) Minimum System Requirement.
b) Download Java as per our system requirement.
c) Set the Java Environment i.e JAVA_HOME and PATH accordingly.
d) Download the TestNG archive according to our system requirement.
e) Set the TestNG Environment i.e. TESTNG_HOME.
f) Set CLASSPATH variable for TestNG. 

TestNG Reporting Support: 

TestNG generates test reports in HTML and XML formats. WebDriver does not have any native mechanism for generating reports. TestNG window is more useful than console window in Eclipse as it generates text-based result while TestNG window generates graphical output of the test result. It gives the Runtimes of each and every method and also the order in which methods are executed.

e.g. 



58 comments:

  1. Esteyaque, thanks for Blog, I am new to these thing and starting learning this. It is really helpful.

    ReplyDelete
  2. Nice information about the load testing!!! I prefer Loadrunner automation testing tool to validate the performance of software application/system under actual load. Loadrunner Course in Chennai | Loadrunner training institute in Chennai

    ReplyDelete
  3. Software testing industry offer huge career opportunity for talented professionals. software testing course in Chennai

    ReplyDelete
  4. Hi, I am really happy to found such a helpful and fascinating post that is written in well manner. Thanks for sharing such an informative post. keep update your blog. Selenium Training in Chennai

    ReplyDelete
  5. Hi, This is really nice blog. You have done really great job. Keep posting.
    Regards..
    QTP Training in Chennai

    ReplyDelete
  6. Thanks for sharing such informative article on Loadrunner Automation testing tool. This load testing tool will provide most precise information about the quality of software. Loadrunner Training in Chennai | Best Loadrunner training institute in Chennai

    ReplyDelete
  7. Excellent Post!! I am really very happy to found such helpful and fascinating post that is written in well manner.Keep posting.
    QTP Training in Chennai | Software Testing Training in Chennai | Selenium Training in Chennai

    ReplyDelete
  8. Thanks for your post; selenium is most trusted automation tool to validate web application and browser. This tool provides precise and complete information about a software application or environment. Selenium Training in Chennai | Selenium Course in Chennai | Best Selenium training institute in Chennai

    ReplyDelete
  9. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it. The angular js programming language is very popular which are most widely used.
    Angularjs Training in Chennai | Angularjs training Chennai

    ReplyDelete
  10. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Java Training in Chennai | Core Java Training in Chennai

    Online Java Training Java Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai

    ReplyDelete
  11. Professional Expert level Android Training in chennai, Android App Development
    Android Training | Android App Development | Training in chennai

    ReplyDelete
  12. I like to post here something useful for the freshers and the experienced professionals out well who are looking for an Android App which helps you in developing your own Android App Development and also it provides Android training and placement in Chennai

    ReplyDelete
  13. Professional Expert level Hadoop Training in Chennai, Big Data Training in Chennai
    Big Data Training | Hadoop Training in Chennai | <a href="http://www.credosystemz.com/training-in-chennai/best-hadoop-training-chennai//>Hadoop Training</a>

    ReplyDelete
  14. CREDO SYSTEMZ provides best software training in Chennai which includes all the latest technologies too such as ANDROID TRAINING, SELENIUM TRAINING, HADOOP TRAINING, BIGDATA TRAINING, SOFTWARE TESTING TRAINING

    ReplyDelete
  15. Thanks for posting this useful content, Good to know about new things here, Let me share this,
    AngularJS Training in Chennai | AngularJS Training | AngularJS Training Institute in Chennai

    ReplyDelete
  16. Thanks for posting this useful content, Good to know about new things here, Let me share this,
    AngularJS Training in Chennai | AngularJS Training | Best AngularJS Training Institute in Chennai

    ReplyDelete
  17. Thank you for this informative questions which help in knowing more about TestNG in selenium

    Regards
    www.udzial.com

    ReplyDelete
  18. The interview questions shared are very much useful Thanks for sharing it
    Hadoop Training in Chennai

    ReplyDelete
  19. If your performance will be good, the game will reward you. Some bonuses will appear during the game play of tank trouble..software testing training in chennai with placement

    Best software testing training institute in chennai

    ReplyDelete
  20. Nice post. Very interesting to read. Thank you for Sharing.
    erp in chennai

    ReplyDelete
  21. Thanks for sharing this post with us it is a worth read

    ReplyDelete
  22. hi welcome to this blog. really you have post an informative blog. it will be really helpful to many peoples. thank you for sharing this blog.
    android training in chennai

    ReplyDelete
  23. Good and nice blog post, thanks for sharing your information.. it is very useful to me.. keep rocks and updating..

    Software Testing Training in chennai

    ReplyDelete
  24. It has been simply incredibly generous with you to provide openly what exactly many individuals would’ve marketed for an eBook to end up making some cash for their end, primarily given that you could have tried it in the event you wanted.

    Selenium Training in Chennai

    Selenium Training in Bangalore

    ReplyDelete
  25. These question and answers are more than enough for any fresher to get a job in a reputed company. Thanks for sharing...
    Manual Testing Online Training | Selenium Training

    ReplyDelete
  26. Great Article...Thanks for sharing the best information,these interview question and answers are so essential to achieve good results in interviews.
    R Programming Training in Chennai
    R Programming

    ReplyDelete
  27. Appreciation for really being thoughtful and also for deciding on certain marvelous guides most people really want to be aware of.

    AWS Training in Chennai



    ReplyDelete

  28. Your new valuable key points imply much a person like me and extremely more to my office workers. With thanks; from every one of us.
    AWS Online Training

    ReplyDelete
  29. This comment has been removed by the author.

    ReplyDelete

  30. I would like to thank you for your nicely written post, its informative and your writing style encouraged me to read it till end. Thanks

    angularjs-Training in annanagar

    angularjs Training in chennai

    angularjs Training in chennai

    angularjs Training in bangalore

    ReplyDelete

  31. I would like to thank you for your nicely written post, its informative and your writing style encouraged me to read it till end. Thanks

    angularjs-Training in annanagar

    angularjs Training in chennai

    angularjs Training in chennai

    angularjs Training in bangalore

    ReplyDelete
  32. A universal message I suppose, not giving up is the formula for success I think. Some things take longer than others to accomplish, so people must understand that they should have their eyes on the goal, and that should keep them motivated to see it out til the end.
    python training in velachery | python training institute in chennai

    ReplyDelete
  33. I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing.. Believe me I did wrote an post about tutorials for beginners with reference of your blog. 

    Online DevOps Certification Course - Gangboard
    Best Devops Training institute in Chennai

    ReplyDelete
  34. A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article. I am learning a lot from you.

    rpa training in electronic-city | rpa training in btm | rpa training in marathahalli | rpa training in pune

    ReplyDelete
  35. This looks absolutely perfect. All these tiny details are made with lot of background knowledge. I like it a lot. 
    Java training in Indira nagar | Java training in Rajaji nagar

    Java training in Marathahalli | Java training in Btm layout

    ReplyDelete
  36. Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care and we take your comments to heart.As always, we appreciate your confidence and trust in us

    Data Science Training in Indira nagar | Data Science Training in Electronic city

    Python Training in Kalyan nagar | Data Science training in Indira nagar

    Data Science Training in Marathahalli | Data Science Training in BTM Layout

    ReplyDelete
  37. A universal message I suppose, not giving up is the formula for success I think. Some things take longer than others to accomplish, so people must understand that they should have their eyes on the goal, and that should keep them motivated to see it out til the end.
    Data Science course in kalyan nagar | Data Science course in OMR

    Data Science course in chennai | Data science course in velachery

    Data science course in jaya nagar | Data science training in tambaram

    ReplyDelete
  38. Whoa! I’m enjoying the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability and visual appeal. I must say you’ve done a very good job with this.

    AWS Training in Bangalore | Amazon Web Services Training in bangalore
    AWS Training in pune | Amazon Web Services Training in Pune, india
    AWS Training in Chennai|Amazon Web Services Training in Chennai,India

    aws online training and certification | amazon web services online training ,india

    ReplyDelete

ads

ads2

adunit1