Sudhir
Sudhir

Reputation: 1472

TestNG - @DataProvider annotation not working in Eclipse IDE?

I am Using TestNG with Selenium WebDriver. I am trying to get the 'dataprovider' annotation working in my Eclipse IDE. However, after adding the below annotation, Eclipse displays the following errors:

  @DataProvider(name = "test1")
  public Object[][] createData1() {
   return new Object[][] {
     { "Cedric", new Integer(36) },
     { "Anne", new Integer(37)},
   };
  }

ERROR:

Multiple markers at this line:

I am using the latest version of TestNG:

6.8.6.20130517

I am using Eclipse Indigo. The weird thing is that on a different machine (My personal laptop), I am running Eclipse Juno, and the @dataprovider annotation works just fine with no issues.

Any Help would be much appreciated?

Thanks.

Upvotes: 0

Views: 2313

Answers (1)

Cedric Beust
Cedric Beust

Reputation: 15608

You must have an import of EcmascriptProtos.Object, remove it. The Object returned by the data provider are regular java.lang.Objects.

Upvotes: 1

Related Questions