Reputation: 1472
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:
Type mismatch: Cannot convert from String to EcmascriptProtos.Object
Type mismatch: Cannot convert from Integer to EcmascriptProtos.Object
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
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