Why is testNG skipping my test?

Here is the code:

@DataProvider(name = "DataSource")
public String dataProvider() {

    String name = "ramesh";

    return name;
}

@Test(dataProvider="DataSource")
public void wikiTest(String name) {

    System.out.println(name);

}

I get the output as

SKIPPED: wikiTest

can anyone help me with this?

+3
source share
1 answer

I'm not sure, but the DataProvider should return an Object [] [] or Iterator.

http://testng.org/doc/documentation-main.html#parameters-dataproviders


@DataProvider(name = "DataSource")
public Object[][] dataProvider() {
    return new Object[][]{
      {"ramesh"}
    };
}
+7
source

Source: https://habr.com/ru/post/1783866/


All Articles