- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
How to set priority to the test cases in TestNG?
We can set priority for test cases in order of their execution, by giving priority to each test method. A test method having lower priority runs first then the test methods with higher priority are executed.
Example
@Test (priority = 1) public void verifyTravel(){ System.out.println("Travel history successful "); } @Test (priority = 2) public verifyIncome(){ System.out.println ("Income history successful"); }
In the Java class file, verifyTravel() will run first followed by verifyIncome().
- Related Articles
- How to run multiple test cases using TestNG Test Suite in Selenium?
- What is the order of test execution with priority in TestNG?
- How to incorporate and remove test methods from execution from a collection of test cases in TestNG?
- How can a particular group of test cases get executed in TestNG?
- How to include and exclude test methods from a set of test cases in Cucumber?
- How to Write Test Cases?
- How to run test groups in TestNG?
- How to group test cases in Pytest?
- How to run multiple test classes in TestNG?
- How to skip TestNG test at runtime?
- How to combine multiple groups to single Test in TestNG?
- How to skip a particular test method in TestNG?
- How to disable an entire unit test in TestNG?
- How to retrieve the test suite name at runtime in TestNG?
- How to set Thread name in TestNG?

Advertisements