Now y'all are already aware close HOW TO INCLUDE OR EXCLUDE SELECTED TEST METHODS IN TEST SUITE. Now our adjacent tutorial is close how to include or exclude selected packet from execution of essay out suite. Supposing y'all bring multiple packages inwards your webdriver test suite as well as you wants to run entirely specific selected package thence how volition y'all produce it? Let nosotros hold off at elementary instance for the same.
First of all configure projection "TestNGOne" amongst iii packages every bit described inwards my previous post.
Configuring testng.xml file to include entirely specific packet inwards essay out suite from multiple packages
As described inwards my THIS POST, nosotros tin use wildcard(.*) amongst packet tag to operate all packages but thence forthwith nosotros volition use include to operate specific packet from all the packages every bit bellow.
<suite name="Suite One"> <test name="Test One" >
<packages> <package name=".*"> <include name="TestNGOnePack" /> </package> </packages>
</test> </suite>
When y'all operate higher upwardly given testng.xml file, it volition operate entirely "TestNGOnePack" packet from all packages of "TestNGOne" project. Look at bellow given TestNg lawsuit report.
If y'all come across inwards higher upwardly essay out lawsuit of webdriver testng suite, entirely classes as well as methods of "TestNGOnePack" packet are executed. remaining 2 packages(TestNGTwoPack as well as TestNGThreePack) are non executed.
Configuring testng.xml file to exclude specific packet from execution
To exclude specific packet from execution, You necessitate to configure your testng.xml file every bit bellow. Supposing I wants to exclude "TestNGThreePack" packet from execution.
<suite name="Suite One"> <test name="Test One" > <packages>
<package name=".*"> <exclude name="TestNGThreePack" /> </package>
</packages> </test> </suite>
Above given testng.xml file amongst exclude "TestNGThreePack" packet from execution as well as volition execute remaining 2 packages every bit shown inwards bellow given written report image.
This means nosotros tin include or exclude amount packet from execution.