Java – why does TestNG skip my tests?

This 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);

}

The output I get is

Who can help me with this?

Solution

I'm not sure if the DataProvider must return object [] [] or iterator

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

@DataProvider(name = "DataSource")
public Object[][] dataProvider() {
    return new Object[][]{
      {"ramesh"}
    };
}
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>