0

I read the relevant documentation and didn't understand it. See also this question.

Community
  • 1
  • 1
ripper234
  • 222,824
  • 274
  • 634
  • 905

1 Answers1

1

To understand that, you must understand testng.xml. Now reread the same thing,

The annotated method will be run before any test method belonging to the classes inside the <test> tag is run.

It should be clear that this annotation will only work with the methods those belong to the classes defined under <test> tag in testng.xml.

Kev
  • 118,037
  • 53
  • 300
  • 385
Adeel Ansari
  • 39,541
  • 12
  • 93
  • 133