100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Lecture notes

TestNG FrameWork

Rating
-
Sold
-
Pages
85
Uploaded on
16-03-2023
Written in
2021/2022

The document may cover the following topics: Introduction to TestNG: This section would provide a brief overview of TestNG, its history, and its features. TestNG Annotations: This section would cover the different types of annotations available in TestNG and how they can be used to control the flow of test execution. TestNG Configuration: This section would provide information on how to configure TestNG for a project, including how to set up test suites, test groups, and parameters. TestNG Reporters: This section would describe the different types of reporters available in TestNG and how to use them to generate reports. TestNG Data Providers: This section would explain how to use TestNG's data providers to supply test data to test methods. TestNG Assertions: This section would cover the different types of assertions available in TestNG and how to use them to verify test results. TestNG Integration: This section would provide information on how TestNG can be integrated with other tools and frameworks, such as Maven, Jenkins, and Selenium. Best Practices: This section would provide guidelines on how to use TestNG effectively, including tips on writing good test cases, using annotations correctly, and organizing tests. Overall, the document would aim to provide a comprehensive guide to using TestNG for software testing, including both basic and advanced features.

Show more Read less
Institution
Module











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Module

Document information

Uploaded on
March 16, 2023
Number of pages
85
Written in
2021/2022
Type
Lecture notes
Professor(s)
Arun
Contains
All classes

Subjects

Content preview

,About the Tutorial
TestNG is a testing framework developed in the lines of JUnit and NUnit,
however it introduces some new functionalities that make it more powerful and
easier to use.

TestNG is designed to cover all categories of tests: unit, functional, end-to-end,
integration, etc., and it requires JDK 5 or higher.

This tutorial provides a good understanding on TestNG framework needed to test
an enterprise-level application to deliver it with robustness and reliability.


Audience
This tutorial is designed for software professionals interested in learning the
features of TestNG Framework in simple and easy steps and implement it in
practice.


Prerequisites
Before proceeding with this tutorial, you should have a basic understanding of
Java programming language, text editor, and execution of programs, etc. As you
are going to use TestNG to handle all levels of Java project testing, it will be
helpful if you have a prior knowledge of software development and software
testing processes.


Copyright & Disclaimer
 Copyright 2015 by Tutorials Point (I) Pvt. Ltd.

All the content and graphics published in this e-book are the property of
Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain,
copy, distribute or republish any contents or a part of contents of this e-book in
any manner without written consent of the publisher.

We strive to update the contents of our website and tutorials as timely and as
precisely as possible, however, the contents may contain inaccuracies or errors.
Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy,
timeliness or completeness of our website or its contents including this tutorial.
If you discover any errors on our website or in this tutorial, please notify us at





i

,Table of Contents
About the Tutorial ..................................................................................................................................... i

Audience .................................................................................................................................................... i

Prerequisites .............................................................................................................................................. i

Copyright & Disclaimer .............................................................................................................................. i

Table of Contents ...................................................................................................................................... ii


1. OVERVIEW ............................................................................................................................ 1

What is TestNG? ....................................................................................................................................... 1

TestNG Features ....................................................................................................................................... 2


2. ENVIRONMENT ..................................................................................................................... 3

System Requirement................................................................................................................................. 3

Step 1: Verify Java Installation in Your Machine ....................................................................................... 3

Step 2: Set JAVA Environment................................................................................................................... 4

Step 3: Download TestNG Archive ............................................................................................................ 5

Step 4: Set TestNG Environment ............................................................................................................... 5

Step 5: Set CLASSPATH Variable ................................................................................................................ 6

Step 6: Test TestNG Setup ......................................................................................................................... 6

Step 7: Verify the Result............................................................................................................................ 7


3. WRITING TESTS ..................................................................................................................... 8

4. BASIC ANNOTATIONS .......................................................................................................... 13

Benefits of Using Annotations................................................................................................................. 14


5. EXECUTION PROCEDURE ..................................................................................................... 15

6. EXECUTING TESTS ............................................................................................................... 19

Create a Class .......................................................................................................................................... 19

ii

, Create Test Case Class ............................................................................................................................. 20

Create testng.xml.................................................................................................................................... 21


7. SUITE TEST .......................................................................................................................... 22

Create a Class .......................................................................................................................................... 22

Create Test Case Classes ......................................................................................................................... 23


8. IGNORE A TEST.................................................................................................................... 27

Create a Class .......................................................................................................................................... 27

Create Test Case Class ............................................................................................................................. 28

Create testng.xml.................................................................................................................................... 29


9. GROUP TEST........................................................................................................................ 30

Create a Class .......................................................................................................................................... 30

Create Test Case Class ............................................................................................................................. 31

Create testng.xml.................................................................................................................................... 32

Group of Groups ..................................................................................................................................... 34

Exclusion Groups..................................................................................................................................... 35


10. EXCEPTION TEST ................................................................................................................. 36

Create a Class .......................................................................................................................................... 36

Create Test Case Class ............................................................................................................................. 37

Create Test Runner ................................................................................................................................. 38


11. DEPENDENCY TEST .............................................................................................................. 39

Example Using dependsOnMethods ........................................................................................................ 39

Example Using dependsOnGroups........................................................................................................... 42

dependsOnGroups Vs dependsOnMethods ............................................................................................ 45


12. PARAMETERIZED TEST......................................................................................................... 46


iii
£13.80
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
mohammadyazdan5

Get to know the seller

Seller avatar
mohammadyazdan5 Exam Questions
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
2 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions