07_01_TestNG Groups Include, Exclude with Example - Selenium Tutorial
07_01_TestNG Groups Include, Exclude with Example - Selenium Tutorial
Include, Exclude
with Example -
Selenium Tutorial
May-2019
RBVH/ENG1
Content
What is Group test
TestNG Groups with Example
Set maven and Java path in environment variable (for windows use
r)
Introduction to XML and how to make an XML files
Another mechanism instead of Grouping is “exclude” or “include” i
n test XML
How to run code using XML file (video demo)
2
What is Group test
3
TestNG Groups with Example
We use groups in Testng when,
•We don't want to define test methods separately in different
classes (depending upon functionality) and
•At the same time want to ignore (not to execute) some test
cases as if they does not exist in the code.
•So to carry out this we have to Group them. This is done by
using "include" and "exclude" mechanism supported in testNG.
4
1.Groups on Methods
5
1.Groups on Methods
6
2. Groups on Class
7
2. Groups on Class
8
3. Misc Examples
9
How to Run Multiple Test Suites
in Selenium
tep 1) Creating a TestNG.xml file for executing test
10
Step 2) Parallel execution in TestNG
11
Step 2) Parallel execution in TestNG
12
Output:
13
RBVH/ENG1
Conclusion
Here we have seen in above example, how to use Testng to
execute parallel test. TestNG gives an option to execute multiple
test in parallel in a single configuration file (XML).
14
RBVH/ENG1
Reference
https://www.guru99.com/testng-execute-multiple-test-suites.html
15