O'Reilly logo

TestNg Beginner's Guide by Varun Menon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Test annotation

One of the basic annotations of TestNG is the Test annotation. This annotation marks a method or a class as part of the TestNG test. If applied at class level this annotation will mark all the public methods present inside the class as test methods for TestNG test. It supports lot of attributes which you can use along with the annotation, which will enable you to use the different features provided by TestNG. The following is a list of attributes supported by the Test annotation:

Supported attributes

Description

alwaysRun

Takes a true or false value. If set to true this method will always run even if its depending method fails.

dataProvider

The name of the data provider, which will provide data for data-driven testing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required