Hello Everyone! Welcome back to MODTECHSTUFF. In this blog, we will talk about how to setup TestNG on Eclipse step by step!
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
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.
You will see TestNG for Eclipse, click on the install button, in my case, I have already installed TestNG plugin on my machine
After installing the TestNG Plugin, Eclipse is restarted, click on File-> New-> Java Project.
The next screen will display Java Settings. Go to Libraries and click on Add Library.
Select TestNG and click next. TestNG is now ready for use.
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
Now click on TestNG and it will display TestNG Class.
On the next screen, it will ask you to enter new TestNG class details.
After clicking on the finish button, you will see a screen like shown below
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).
Valuable information. Thankyou sir...
ReplyDeleteI have a doubt is Eclipse IDE is an open source software or we have to pay for it?
Thank you
Eclipse IDE is an open source software. You don't have to pay for it.
DeleteThankyou
Can we use other softwares rather than Eclipse???
ReplyDeletevery useful blog
ReplyDeleteplease visit my blog
https://kidscricketcoaching.blogspot.com/2020/05/episode-14-back-foot-batting-drills.html
Ok sure
Delete