2

I started learning TestNG but i got stuck so i need little help related to syntax I have already using annotation dataProvider

@Test(dataProvider="getdata")
public void testCase02(String text1,String text2){
    System.out.println("I m in second testcase");
    System.out.println(text1);`
    System.out.println(text2);
}

But i also want to use annotation (groups="group") so can anyone help me out for syntax to use both annotation together.

Prasad Khode
  • 6,602
  • 11
  • 44
  • 59
shubham bansal
  • 796
  • 1
  • 5
  • 13

1 Answers1

6

To mark a test method to belong to a group, you need to do is specify the groups attribute of the Test

@Test(dataProvider="getdata", groups = {"groupName"})
public void testCase02(String text1,String text2) {

There is a detailed documentation from testng around it.

Mani
  • 1,068
  • 3
  • 13
  • 27
Naman
  • 27,789
  • 26
  • 218
  • 353
  • Can you please suggest me some documents or sites to crate framework on testNG – shubham bansal Mar 12 '17 at 03:04
  • 2
    @shubhambansal Already linked there documentation page. You can go ahead and use it to create framework as well. – Naman Mar 12 '17 at 03:06
  • @shubhambansal If this helps, could you please accept it as an answer so that its useful for any future readers. – Naman Sep 16 '17 at 02:29