public Object[][] dp1() {
return new Object[][] {
new Object[] { "a", "b" },
new Object[] { "c", "d" },
};
}
public Object[][] dp2() {
return new Object[][] {
new Object[] { "e", "f" },
new Object[] { "g", "h" },
};
}
@DataProvider
public Object[][] dp() {
List<Object[]> result = Lists.newArrayList();
result.addAll(Arrays.asList(dp1()));
result.addAll(Arrays.asList(dp2()));
return result.toArray(new Object[result.size()][]);
}
@Test(dataProvider = "dp")
public void f(String a, String b) {
System.out.println("f " + a + " " + b);
}
Friday, December 21, 2018
TestNG - Can i use the 2 different data providers to same @test methods in TestNG?
Subscribe to:
Post Comments (Atom)
TestNG - Can i use the 2 different data providers to same @test methods in TestNG?
public Object [][] dp1 () { return new Object [][] { new Object [] { "a" , "b" }, new Obje...
-
public Object [][] dp1 () { return new Object [][] { new Object [] { "a" , "b" }, new Obje...
-
package programs; import java.util.Scanner; public class ReverseNumber { public void reverseNumber(){ Scanner scn = new ...
-
package programs; import java.util.HashMap; public class CountNumberInArray { public static void main(String[] args) { int[] a =...
This comment has been removed by the author.
ReplyDeleteThanks for your information. very good article.
ReplyDeleteSelenium Online Training India
Selenium Online Training