Search code examples
eclipseseleniumtestingselenium-webdrivertestng-eclipse

Unable to install TestNG plugin in latest Eclipse IDE


I am getting below error when trying install TestNG in latest Eclipse:

enter image description here

Could anyone help out in resolving this issue as my project uses TestNG in the Test framework


Solution

  • Please follow the below steps and anybody can get the testNG working in any version of Eclipse:

    1. Download the source code from the github : testNG Source in Git and take any version that suits your needs

    TestNG official Git Source

    1. Once downloaded extract the folder to eclipse directory: Let's assume hypothetically you have kept it in C: drive, then the path where you would extract is: C:\eclipse\dropins : Preferably use 7zip extracter to unzip it to directory Downloaded TestNG source zip

    2. Extract and place the folder in dropins folder of eclipse Extracted TestNG folder in dropin folderInternal of extracted folder, just for reference

    3. Once extracted, you need to add one file to the folder: site.xml. Create a site.xml file and add the below details: and where ever <TestNG_Version_downloaded> is quoted, please don't forget to add the testNG version downloaded

       <?xml version="1.0" encoding="UTF-8"?>
       <site>
      <feature url="features/org.testng.eclipse_<TestNG_Version_downloaded>.jar" id="org.testng.eclipse" version="<TestNG_Version_downloaded>">
         <category name="org.testng.eclipse"/>
      </feature>
      <feature url="features/org.testng.eclipse.maven.feature_7.0.0.201908240652.jar" id="org.testng.eclipse.maven.feature" version="<TestNG_Version>">
         <category name="org.testng.eclipse"/>
      </feature>
      <category-def name="org.testng.eclipse" label="TestNG"/>
      

    and the xml file content just for reference: XML file view in browser(For reference)

    1. Once Everything is done: Go to Eclipse, and perform ctrl+N and you can see testNG appearing in the menu and that's it and you are ready to use TestNG. Happy Coding!!TestNG in EclipseTestNG in Eclipse