How to Configure TestNG in Android Studio?


 

In our previous tutorial, we have learnt about Junit Testing framework and now in this we will get to know about one more powerful testing framework called TestNG. TestNG framework as some different functionalities which makes it more powerful testing framework..

What is TestNG Framework?

TestNG is a testing framework developed from inspiration of Junit and Nunit with additional features making is more effective and simple for use. It is a powerful automation testing framework where NG Stands for Next Generation. It gives developers power to write more flexible and powerful test cases.

Features of TestNG –

  • It allows you to use new features of Java programming language while writing test cases.
  • Like Junit it provides annotations to identify your test methods and flow of execution.
  • Separates compile time test code and run time configurations.
  • Provides powerful test case execution support.
  • Allows you to perform multithreading testing.
  • Initially It was designed for unit testing but now allows load testing , parallel testing etc.

There is so much more in this and we will explore more and more when we start coding. But it is very important to learn basics about Testing frameworks before writing your test cases as selection of right framework is like building pillar for your automation framework.

How to Setup TestNG –

    • Create and Android Project or open your existing project

 

    • Go to app -> build.gradle

 

  • Copy the below line of code in your dependencies section.
     
  • Click on Sync
  • Once you get build successful message then you are ready to go.

 






Leave a Reply