- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Name the various annotations available in TestNG.
The various annotations available in TestNG are listed below −
@Test − This is used before every test method in the java class file.
@BeforeSuite − This is used to run a particular test method before all the test methods.
@AfterSuite − This is used to run a particular test method after all the test methods.
@BeforeClass − This is used to run a particular test method only once before the first test method.
@AfterClass − This is used to run a particular test method only once after all the test methods in the present java class file are done with execution.
@BeforeTest − This is used to run before any test method inside @Test tag.
@AfterTest − This is used to run after any test method inside @Test tag
@BeforeGroup − This is used to run a test method only once before every test method that belongs to a particular group.
@AfterGroup − This is used to run a test method only once after every test method that belongs to a particular group.
@BeforeMethod − This is used to run a test method before every test method present in that java class file.
@AfterMethod − This is used to run a test method after every test method present in that java class file.
- Related Articles
- What are the annotations in TestNG?
- What are the various waits available in Selenium with python?
- What are the various JSON files available in C# ASP.NET Core?
- What are the various methods available under Select class in Selenium?
- What are various Inheritance mapping strategies available in Hibernate?
- How to set Thread name in TestNG?
- How to specify method name sequence in TestNG?
- How to retrieve the test suite name at runtime in TestNG?
- Function Annotations in Python
- Name the various types of forces.
- How to retrieve all test methods name in TestNG suite?
- What are annotations in Java?
- Get the class name for various objects in Java
- Name the sources of freshwater available on the Earth.
- Name the various types of chemical reactions.
