Setting up TestNG with Eclipse

by seetaram on January 9, 2012

This post will explain about installation of TestNG plug-in with Eclipse (Indigo)

There is no need to download any Jar file or exe file for installation.  We need to just utilize the “Install New Software” option available in the Eclipse.

Steps for installation:

1. Click Help –> Install New Software




2. Type “” in the “Work with” edit box and click ‘Add’ button

3. In the ‘Name’ column we can see “TestNG” –> Select this and click ‘Next’ button


4.  Click Next and click on the radio button “I accept the terms of the license agreement”

5. Click ‘Next’ button

6. Click ‘Finish’

TestNG-Install wizard

This will install the TestNG plug-in for Eclipse

After the installation, it will ask for restart of Eclipse.  Then restart the Eclipse.

Once the Eclipse is restarted, we can see the TestNG icons & menu items as in the below figures.




It is very much clearly explained how to setup the TestNG with eclipse.  The screenshots make it easy to understand the setting up of TestNG. I hope this will help people who are eager to start using TestNG for their unit testing as well as UI Test Automation with Selenium.

{ 57 comments… read them below or add one }

John January 24, 2012 at 12:31 pm

Thank you Seetaram, this was very useful to me.



jeff April 1, 2012 at 3:37 am

hi was just doing this but now, there are multiple testng versions when I put in the url and. Also the icon doesn’t match. This new plugin is giving me issues. I had the old plugin before and it works, but now it won’t let me install the old one. what can i do?


Nandan May 14, 2012 at 1:28 pm

seetaram your blog has been a handbook for all Selenium details! thanks a ton


Chaithra June 8, 2012 at 6:28 am

am getting error on running TestNG class file
error: “java.lang.NoSuchMethodError: org.openqa.selenium.remote.DesiredCapabilities.safari()Lorg/openqa/selenium/remote/DesiredCapabilities;”

code is attached here,

package pacakge1;

import org.openqa.selenium.server.RemoteControlConfiguration;
import org.openqa.selenium.server.SeleniumServer;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.SeleneseTestBase;
import com.thoughtworks.selenium.Selenium;

public class NewTest extends SeleneseTestBase{

public Selenium selenium;
public SeleniumServer seleniumserver;

RemoteControlConfiguration rcc = new RemoteControlConfiguration();
public static final String url = “”;
public String GetCurPageURL;

public void setupBeforeClass() throws Exception {

selenium = new DefaultSelenium(“localhost”, 4444, “*firefox”, “http://”);
seleniumserver = new SeleniumServer(rcc);

public void Login() throws Exception {
selenium.type(“txtName”, “AdminVLE”);
selenium.type(“txtPwd”, “AdminVLE”);“SignIn”);

public void teardownAfterClass() throws Exception{



seetaram June 9, 2012 at 6:10 am

Hello Chaithra,

I have tried your code, but not getting any exception. Can you try putting a break point and do step by step debug? Find out from where the exception is coming.


Chintan June 9, 2012 at 5:47 pm

Thank you very much Seetaram.


Chaithra June 11, 2012 at 6:23 am

Hi seetaram,

The problem raised at the selenium server start up. So this comes in @BeforeClass annotation.


Chaithra June 11, 2012 at 6:46 am

Hi Seetaram,

One of my other query is, how to provide the dynamic Page url for each @Test method in TestNg class file?

Suppose… Once class file has 3 @ test methods. So how can i pass Dynamic page url for the 2nd and 3 rd @Test method to find the page objects?



narla June 13, 2012 at 4:24 pm

Thanks a lot. Easy steps to follow ….


sri June 14, 2012 at 6:44 am

I am getting following error while installing TestNG framework on eClipse-Helios:
Cannot complete the install because one or more required items could not be found.
Software currently installed: Shared profile (SharedProfile_epp.package.jee
Missing requirement: Shared profile (SharedProfile_epp.package.jee requires ‘SharedProfile_epp.package.jee []’ but it could not be found
could you please help me in resolving this issue..


raju dantuluri June 26, 2012 at 1:34 pm

Your help is appreciable


vikas July 2, 2012 at 4:22 pm

Hi seetaram , I tried installin

An error occurred while collecting items to be installed


Melody July 18, 2012 at 2:27 pm

Hello seetaram,

I cannot pick the testing.xml to set up the TestNG Suite executuion. The “browse” button does not browse on the “Suite” option. Can you assist?


seetaram July 29, 2012 at 12:42 pm

Hi Melody,

I need more info..can you elaborate please..


mangesh September 17, 2012 at 7:16 am

seetaram you have done a very good job, seetaram you are great…


Saleem Darbar September 25, 2012 at 4:25 pm

Hi ,
I followed all the steps to configure the TestNg,but
when I am trying to run the Testcase through TestNg it’s not working.Can you tell me how to resolve this issue.


Sanjay September 28, 2012 at 6:38 am


i am installing the TestNG using Ecilpce software but in setp2 its gives the error “can not find” please suggest me solution or clarify me where i am wrong.


dolly May 9, 2013 at 8:47 am

avoid using quotation marks.
use . Then u will find “TestNG” in the “Name” column


Arjun January 10, 2013 at 4:27 am

Thank you so much for this valuable post. It made things real easy.


MrBCut January 27, 2013 at 7:33 pm

Excellent tutorial! thanks so much 🙂


Balu February 10, 2013 at 10:55 am

Thanks. It helped me


Chirag Desai February 12, 2013 at 9:50 am

Thanks Seetaram. It was very helpful.


madesh March 6, 2013 at 5:30 am

wonderful sir
keep up the good work


sanjit paul April 23, 2013 at 5:41 pm

Thanks lot for this post . it is really helpful .


dolly May 9, 2013 at 8:52 am

Very easy to understand.


tunga June 10, 2013 at 6:22 pm

Very useful and precise information


kiran July 23, 2013 at 4:40 pm



Gnaneshwar July 31, 2013 at 1:26 am

I installed the test NG but i couldn’t see the test NG after the installation
Your help is highly appreciated


Isaac August 12, 2013 at 3:04 pm

Great post I have my TestNG options back, delighted!


Pravin August 12, 2013 at 3:24 pm

Thank You Sir…


Bharad October 19, 2013 at 12:50 am

After so much of time exploring “how to install testNG” in google , none of the blogs helpful for me . But this is one of the very best spoonfeed steps here . I really appreciate for your best efforts in providing these steps . It is so useful . Thanks a lot !!


Ilakkuvan November 15, 2013 at 11:20 am

Very useful information shared with world. Thank you very much


Hasitha December 4, 2013 at 7:58 am

Very useful information you share with us. Sir, do you have any document about Annotations used in Test-NG? Because i am new to automation stuff.


seetaram December 6, 2013 at 6:07 am
mahesh December 27, 2013 at 11:12 am

i am learning selenium course.
in my institute they are explaining webdriver and testing frameworks only,is it necessary to learn selenium RC.


seetaram January 10, 2014 at 6:57 am

I dont think that is needed now


mahesh December 27, 2013 at 11:15 am

i downloaded poi api,but every time only four files are coming .can u explain way to download poi api to work with excel sheet


seetaram January 10, 2014 at 7:02 am

POI is a folder containing many files, add the the jar files to the classpath which are appropriate for the APIs you are using.


Ramesh Reddy January 9, 2014 at 9:05 am

Thank you very much…this helped me to install testNG easily.


Taruna May 24, 2014 at 5:58 am

I am getting File transfer error while installing testNG in Galileo & Helio.


mogannagowda June 13, 2014 at 8:37 am

Thanks a log…….


vissu August 20, 2014 at 10:03 am

Thank you for the screen shots in detail..


Sylvia Ombuya September 29, 2014 at 9:42 pm

This was very helpful. Thank you


harish October 8, 2014 at 8:18 am

In my eclipse(europa) Help –> Install New Software option is not there…how to install testNG then??

only s/w upadte option is there!!


shanthi January 3, 2015 at 12:43 pm

while installing the testNG iam getting error as: ” unable to read reposity at http:/eclipse/content.xml ”

Could you please suggest me how to resolve this .

Thanks a lot in advance.


Hema March 10, 2015 at 5:59 am

I am a newbie in automation. I have a very basic doubt when I create a java project (which also contains javascript ) I write a testNG file. How is the testing.xml created? or should I create testing.xml separately?


prateek bhati March 13, 2015 at 5:32 am

Thanxx a lot,for the screen shots


Sowndarya June 23, 2015 at 12:52 pm

I installed the test NG but i couldn’t see the test NG after the installation.
Thanks in advance


Rajesh July 7, 2015 at 6:01 am


I am a beginner and I want to use TestNG, when I proceed with the steps mentioned and clicked on “Add”, it shows there are no items available.

I use JDK 8.0.

Thanks in Advance,

Rajesh Gokul.S


Saurav August 3, 2015 at 11:24 am

It worked for me very well on an Ubuntu machine. 12.04LTS. Installed on Eclipse Juno 4.2


Sony September 2, 2015 at 8:32 am

Am new to selenium, after installing TestNG, while running testNg
An internal error occurred during: “Launching test_NG”. org.osgi.framework.Version.compareTo(Lorg/osgi/framework/Version;)I


mohit October 28, 2015 at 6:19 am

on installing testNG i am getting following error…

how can i solve it…..

An error occurred while collecting items to be installed
session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
Problems downloading artifact: osgi.bundle,org.testng.eclipse,
MD5 hash is not as expected. Expected: 5e8dd350672caf82ef56d27865fb822e and found a715c20c11c2320b2656d1cb3c7d94a5.


shreya abrol February 11, 2016 at 7:18 am

I am a newbie in automation. I have a very basic doubt when I create a java project (which also contains javascript ) I write a testNG file. How is the testing.xml created? or should I create testing.xml separately?


children of sanchez June 4, 2016 at 10:55 am

you’re in reality a just right webmaster. The website loading velocity
is amazing. It kind of feels that you are doing any distinctive trick.
Furthermore, The contents are masterpiece. you’ve performed
a wonderful task in this topic!


Vishvanath Chougule June 22, 2016 at 4:31 pm

Getting below error while installing TestNG

“Cannot complete the install because one or more required items could not be found.
Software being installed: TestNG M2E Integration (Optional) (”


sashnak September 29, 2017 at 1:18 pm


I have installed testng but i am unable to see the testng under prefaces. Kindly help.


seetaram November 26, 2017 at 12:16 pm

Now you can easily download and install TestNG from the eclipse marketplace. Once it is installed, create a project and a TestNG class. Right click on the TestNG class then you can see TestNG option available there


Leave a Comment

Previous post:

Next post:

Do you want to get updates on the recent articles written? Please subscribe to RSS feed or Email