Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to Install TestNG in Eclipse for Selenium Webdriver

Posted by shuseel

While going through the series of Selenium Webdriver tutorials, we are introducing in this tutorial about Testng and the different methods to install TestNG in Eclipse for Selenium WebDriver. Before going to the installation process, let’s begin with what the TestNG is and why to use TestNG with Selenium WebDriver.

TestNG is an open source automation testing framework which was inspired by JUnit that uses annotations for managing test cases more efficiently. In TestNG, “NG” means Next Generation, so it was the testing framework built for the next generation that eliminates most of the limitations of the older testing frameworks like JUnit and NUnit. TestNG allows the testers to write more powerful and flexible tests than other testing frameworks.

Why Use TestNG With Selenium WebDriver

Since, selenium WebDriver have some limitations for generating test results, managing and running the test. Using TestNG with selenium WebDriver can overcome all the limitations of using default selenium. Following are the most important features and advantages of using TestNG with selenium.

  1. It can generate the test report in a proper format that includes all the details on how many number of test cases are passed, failed and skipped after executing the test script.
  2. Since, it supports using annotations(@), we can easily manage the test scripts and able to set the priority for running the test cases.
  3. It introduces the test groups, so we can group multiple test cases by converting them into testing.xml file.
  4. Due to its flexible run-time configuration feature, we can execute test cases multiple times without using loops.

How to Install TestNG in Eclipse IDE

There are two methods of installing TestNG in Eclipse for selenium WebDriver, one is using “Install New Software” option available on the help menu and another method is importing TestNG library on the project. Following are the step by step guide for installing TestNG in Eclipse IDE using different methods.

1. Install TestNG from Update Site

Use the following steps to download and install TestNG in Eclipse from the update site.

Step1: Open Eclipse IDE. Go to help menu and click on the option “Install new software as shown on the image below.

Step2: On the new window, click on “Add” button. Give the name i.e. “TestNG” and place “http://beust.com/eclipse” on the location field, then click on “Add” button.

Step3: When searching for the available software finished, give the check mark on “TestNG” and then click on next button.

Step4: On the next window, it will ask to accept the terms of license agreement. So click on “I accept the terms of the license agreement” and then click on the Finish button.

Step5: On the process of installing the plugin, it may give the security warning message. Click on “OK” to continue the installation.

Step6: When the installation completed, it will ask to restart the application. Click on “Yes” to restart the Eclipse IDE.

2. Install TestNG from Eclipse Marketplace

It was a much easy method of installing TestNG on Eclipse than the previous method. Use the following steps in order to install TestNG in Eclipse from Eclipse Marketplace.

Step1: Go to the TestNG page on Eclipse Marketplace.

Step2: Drag the “Install” button provided on the Eclipse Marketplace page and drop to the running Eclipse workspace. I have also added an external install button below that is provided by Eclipse Marketplace. You can directly drag and drop install given below.

It should require “Eclipse Marketplace Client” installed on the Eclipse IDE. To verify whether the “Eclipse Marketplace Client” installed on IDE, go to help menu and observe whether “Eclipse Marketplace” link available as shown on the image below.

Step3: When you have dropped the button, it will show the features that are going to be installed. Click on the confirm button to confirm the selected features and continue the installation as given below.

Step4: On the next window, it will ask to accept the terms of license agreement. So click on “I accept the terms of the license agreement” and then click on the Finish button.

Step5: Click on “OK” to continue the installation when security warning message displayed. When installation finishes, Click on “Yes” to restart the Eclipse IDE.

The post How to Install TestNG in Eclipse for Selenium Webdriver appeared first on InfoTechSite.



This post first appeared on InfoTechSite | A Best Place For Complete IT Tips, please read the originial post: here

Share the post

How to Install TestNG in Eclipse for Selenium Webdriver

×

Subscribe to Infotechsite | A Best Place For Complete It Tips

Get updates delivered right to your inbox!

Thank you for your subscription

×