Skip to main content

How to setup TestNG on Eclipse| QA Automation|

Hello Everyone! Welcome back to MODTECHSTUFF. 
In this blog, we will talk about how to setup TestNG on Eclipse step by step!

Modtechstuff


Table Of Contents

  • 1. What is TestNG?
  • 2. Installing JAVA in your System.
  • 3. Eclipse Installation
  • 4. TestNG Plugin Installation.

What is TestNG?

TestNG is a complete automation testing framework that covers all testing models, for example, unit testing, functional testing,  and an end to end testing. Motivated by JUnit and NUnit, Cedric Beust made TestNG in 2004 to make start to finish testing straightforward and simple. With comments and announcing highlights, TestNG makes it simple to code test cases. TestNG is the short type of Test Next Generation. 
The best part about TestNG is the reporting component. It offers an elaborated test report demonstrating what number of test cases failed, what number of skipped, and what number of succeeded. At the point when you run a test suite with various test cases and in the event that one test case failed, you need to run all test cases again. You can't run the failed test alone. Thus, you will be running successful tests as well. In any case, TestNG permits you to create a failed test report as an XML file. It implies you can run this XML document to run just failed test cases.

Another significant advantage is that you can group numerous test cases and run them as indicated by the pre-characterized sequence or run one case on several moments. TestNG permits equal testing which implies you can run different experiments on numerous stages while effectively incorporating it with CI/CD conditions, for example, Jenkins. 
Annotations are one of the excellent features of TestNG that permits engineers to handily exception the code automatically. While multithreaded testing is braced, runtime setup is adaptable and API comes as a module.

 How to set up a TestNG project?

Installing JAVA in your System.

TestNG requires Java which means you should download and install Java on your system. In my previous blog, I have shown how to install JAVA on your computer in detail. Here is the link  https://modtechstuff.blogspot.com/2020/05/how-to-start-automation-using-selenium.html

Eclipse Installation

Eclipse IDE is one of most liked Java development, though it’s hard to deny it has been losing ground to IntelliJ recently, Eclipse composed for the most part in Java and its essential use is for creating Java applications, yet it might likewise be utilized to create applications in another programming language including C, C++, C#, COBOL, D, Erlang, Fortran, Groovy, Haskell, JavaScript, Julia, Perl, PHP, Prolog, Python, R, Ruby, Scala, and Scheme. It can likewise be utilized to create archives with LaTeX (by means of a TeXlipse module) 
In my previous blog, I have shown how to install ECLIPSE on your computer in detail. Here is the link  https://modtechstuff.blogspot.com/2020/05/how-to-start-automation-using-selenium.html

TestNG Plugin Installation.

After Succesful installation of Eclipse IDE, we have to install a TestNG plugin
When you Launch Eclipse IDE for the first time, you will see a welcome screen like shown below
                   Eclipse IDE


The next step is to click on ‘Help’ and go to Eclipse Market Place and in search text box write TestNG and Press GO Button.


Eclipse IDE


You will see TestNG for Eclipse, click on the install button, in my case, I  have already installed TestNG plugin on my machine


Eclipse IDE


After installing the TestNG Plugin,  Eclipse is restarted, click on File-> New-> Java Project.

                                         Eclipse Project


The next screen will display Java Settings. Go to Libraries and click on Add Library.

Eclipse Ide


Select TestNG and click next. TestNG is now ready for use.

Eclipse Ide


Eclipse Ide


The next step is to create a TestNG File by Opening Eclipse and go to Package Explorer view. Select the test project you named earlier.
 Right-click on src and choose new 
->other

TestNG


Now click on TestNG and it will display TestNG Class.
TestNG Class

On the next screen, it will ask you to enter new TestNG class details.
TestNg class

After clicking on the finish button, you will see a screen like shown below
Eclipse IDE


Congratulations Eclipse will now create your TestNG template automatically and You can start writing your code!

For any query send me a message here. I will ready to help(In FREE).



Author:: HAROON

For more details please visit  MODTECHSTUFF

FOLLOW ME @

      




Comments

  1. Valuable information. Thankyou sir...
    I have a doubt is Eclipse IDE is an open source software or we have to pay for it?
    Thank you

    ReplyDelete
    Replies
    1. Eclipse IDE is an open source software. You don't have to pay for it.
      Thankyou

      Delete
  2. Can we use other softwares rather than Eclipse???

    ReplyDelete
  3. very useful blog
    please visit my blog
    https://kidscricketcoaching.blogspot.com/2020/05/episode-14-back-foot-batting-drills.html

    ReplyDelete

Post a Comment

Donate Us to Keep this site Alive! With PayPal

Popular posts from this blog

How to Automate OTP using Appium and Selenium Framework ?

Hello Everyone! Welcome back to another Fresh article of MODTECHST UFF where you Learn Automation testing. In this article, we will talk about Integrating the OTP SMS reading capability with your Selenium - Appium Framework that will surely help you out. There can be three solutions to this problem. Solution 1: Ask your development team to fix the OTP check process to any static value. Solution 2: Ask your development team to provide you an API in which you can pass some parameter in response he can return you the OTP sent against that number.  Solution 3: Design two Appium scripts one is two handle Websites and one is to handle the Android message box, so after sending OTP from the web execute the second script to read a message from the message box. OTP is a 2-factor authentication mechanism that was build to avoid ROBOT / Automation SO you never find the solution direct solution for that. What is Appium? Appium is an open-source structure that permits you to lead automating test...

How to create my own blog| A complete beginner's guide| Updated(May 2020)

Hello Everyone! Welcome back to MODTECHST UFF.  In this blog, we will talk about How to create your own blog and how to earn from the blog. This guide will provide each and every possible detail about blogging. I realize that beginning a blog can appear to be overpowering and scary. This free guide is tied in with blogging for amateurs and will show you how to be a blogger with simply the most essential PC aptitudes. So whether you're a student or professional, you can make your own blog in just 1 hour!!! I am not afraid to concede that when I was first figuring out how to manufacture a blog I committed a huge amount of errors. You can profit by overtime of my experience so you don't repeat these equivalent mix-ups when you make your own blog. I made this free guide with the goal that anybody can figure out how to blog rapidly and without any problem. What's more, on the off chance that you stall out anytime if you don't mind send me a message and I will give a magnific...

Top 5 Automation Testing Tools[2020]

Hello Everyone! Welcome back to another Fresh article of MODTECHST UFF where you Learn Automation testing. In this article, we will talk about Updated Top 5 Automation Testing Tools[2020] that will surely help you out. Quality at speed is the need of great importance in the product development industry. This is the reason associations are hoping to embrace Agile, Continuous Integration (CD), and DevOps techniques to discover arrangements. Test automation is a basic part of these techniques that can empower associations to give quality at speed.  In straightforward terms, automation testing is a procedure of automated test case execution and the creation of test results with no human intercession. It extensively brings down the expense and exertion that is in any case required in manual testing. It limits the possibility of mistakes by limiting excess manual work.  To execute automation testing, associations require the help of a decent automation testing organization...

Ad

Enter your email address:

Delivered by FeedBurner