1

I am Using TestNG with Selenium WebDriver. I am trying to get the 'data provider' annotation working in my Eclipse IDE. However, after adding overring on the annotation showing error 0

DataProvider is not an annotation type

 package remoteTesting.dockervalidation;
 import org.testng.annotations.Test;
 public class DataProvider {
 @Test
 public void testcaseData() {}

 @DataProvider (name = "DPS1")
    public Object[][] createData1() throws Exception{
        Object[][] retObjArr= {{"hello","text",1},{"bye","message",1},{"solo","call",453}};
        return(retObjArr);
    }
}
Abdelillah Aissani
  • 3,058
  • 2
  • 10
  • 25

2 Answers2

2

Its because your class name is 'DataProvider'. Please change the class name to something else (which will be of more meaning) and try to import DataProvider from testng.

PRERNA PAL
  • 381
  • 2
  • 10
0

I just uninstalled the TestNG plugin and installed it again and it worked for me.

David Buck
  • 3,752
  • 35
  • 31
  • 35