{"id":386,"date":"2021-05-20T12:00:00","date_gmt":"2021-05-20T12:00:00","guid":{"rendered":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/2021\/05\/20\/testng-groups-include-exclude-with-example-selenium-tutorial\/"},"modified":"2021-05-20T12:00:00","modified_gmt":"2021-05-20T12:00:00","slug":"testng-groups-include-exclude-with-example-selenium-tutorial","status":"publish","type":"post","link":"https:\/\/rahulshettyacademy.com\/blog\/2021\/05\/20\/testng-groups-include-exclude-with-example-selenium-tutorial\/","title":{"rendered":"TestNG Groups: Include, Exclude with Example \u2013 Selenium Tutorial"},"content":{"rendered":"<p><html><body><\/p>\n<section class=\"tcb-post-content tcb-shortcode thrv_wrapper\" data-css=\"tve-u-16ec5d248bb\">\n<div class=\"tve_flt tcb-style-wrap\" id=\"tve_flt\">\n<div class=\"tve_shortcode_editor tar-main-content\" data-post-id=\"386\" id=\"tve_editor\">\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>TestNG is a Testing framework that covers different types of test designs like unit, functional, end to end, UI and integration test.<\/p>\n<div class=\"code-block code-block-2\" style=\"margin: 8px auto; text-align: center; display: block; clear: both;\">\n<p><!-- horizontal responsive 2 --><br \/>\n<ins class=\"adsbygoogle\" data-ad-client=\"ca-pub-3231318496783163\" data-ad-format=\"auto\" data-ad-slot=\"2788468763\" data-full-width-responsive=\"true\" style=\"display:block\"><\/ins>\n<\/div>\n<p>You can run a single or multiple packages (package here means to encapsulate a group of classes in a proper director format) by creating XML and run it through maven.<\/p>\n<\/div>\n<div class=\"thrv_wrapper tve-toc tve-elem-scroll tve-toc-expandable tcb-local-vars-root\" data-animation=\"slide\" data-bullet-style='{\"0\":\"tve-u-17399ff41d4\",\"1\":\"tve-u-17399ffc502\",\"2\":\"tve-u-17399ffedb7\"}' data-columns=\"1\" data-css=\"tve-u-1798a39b875\" data-ct=\"toc-60733\" data-ct-name=\"Table of Contents 13\" data-distribute=\"false\" data-element-name=\"Table of Contents\" data-headers=\"h1,h3,h5\" data-heading-style='{\"0\":\"tve-u-1798a39b87d\",\"1\":\"tve-u-1798a39b87e\",\"2\":\"tve-u-1798a39b87f\"}' data-highlight=\"heading\" data-number-style='{\"0\":\"tve-u-17399fecc2c\",\"1\":\"tve-u-173dc8687ce\",\"2\":\"tve-u-173dc86929b\"}' data-numbering=\"none\" data-state-default=\"expanded\" data-state-default-d=\"expanded\" data-transition=\"slide\" style=\"\">\n<div class=\"thrive-colors-palette-config\" style=\"display: none !important\"><\/div>\n<div class=\"tve-toc-divider\" style=\"position: absolute; width: 0; height: 0; overflow: hidden;\">\n<div class=\"thrv_wrapper thrv-divider tve-vert-divider\" data-color-d=\"rgb(217, 217, 217)\" data-style=\"tve_sep-1\">\n<hr class=\"tve_sep tve_sep-1\" style=\"\"\/><\/div>\n<\/div>\n<p><svg class=\"toc-icons\" style=\"position: absolute; width: 0; height: 0; overflow: hidden;\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><symbol data-id=\"icon-chevron_right-duotone\" id=\"toc-bullet-0\" viewbox=\"0 0 24 24\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"><\/path><path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z\"><\/path><\/symbol><symbol data-id=\"icon-chevron_right-duotone\" id=\"toc-bullet-1\" viewbox=\"0 0 24 24\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"><\/path><path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z\"><\/path><\/symbol><symbol data-id=\"icon-chevron_right-duotone\" id=\"toc-bullet-2\" viewbox=\"0 0 24 24\"><path d=\"M0 0h24v24H0V0z\" fill=\"none\"><\/path><path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z\"><\/path><\/symbol><\/svg><\/p>\n<div class=\"tve-content-box-background\" data-css=\"tve-u-1798a39b876\" style=\"\"><\/div>\n<div class=\"thrv_wrapper tve-toc-title tcb-icon-display reverse tve-no-dropzone tve-prevent-content-edit\" data-css=\"tve-u-1798a39b877\" style=\"\">\n<div class=\"tve-content-box-background\" style=\"\"><\/div>\n<div class=\"tve-cb\" style=\"\">\n<div class=\"tve-toc-title-icon\" data-icon-code=\"icon-chevron-down-solid\" style=\"\"><svg class=\"tcb-icon\" data-id=\"icon-chevron-down-solid\" data-name=\"\" viewbox=\"0 0 24 24\"><path d=\"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z\"><\/path><\/svg><\/div>\n<div class=\"thrv_wrapper thrv_text_element tve_no_icons\">\n<div class=\"tcb-plain-text\" data-css=\"tve-u-1798a39b878\" style=\"\">table of contents<\/div>\n<\/p><\/div>\n<\/div>\n<\/div>\n<div class=\"tve-cb tve-toc-content tve-prevent-content-edit\" style=\"\">\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\" data-css=\"tve-u-1798a39b879\" style=\"\">\n<div class=\"tve-content-box-background\" data-css=\"tve-u-1798a39b87a\" style=\"\"><\/div>\n<div class=\"tve-cb\"><\/div>\n<\/div>\n<div class=\"thrv_wrapper tve-toc-list tcb-no-delete tcb-no-save tcb-no-clone tve-no-dropzone\" data-css=\"tve-u-1798a39b87b\" style=\"\">\n<div class=\"tve-content-box-background\" data-css=\"tve-u-1798a39b87c\" style=\"\"><\/div>\n<div class=\"tve-cb\">\n<div class=\"tve_ct_content tve_clearfix\">\n<div class=\"ct_column\">\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-1798a39b87e\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1621521414276\" jump-animation=\"smooth\">TestNG Groups with Example<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-1798a39b87e\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1621521414277\" jump-animation=\"smooth\">Introduction to XML and how to make an XML files<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-1798a39b87e\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1621521414278\" jump-animation=\"smooth\">Another mechanism instead of Grouping is &#8220;exclude&#8221; or &#8220;include&#8221; in test XML<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level2 tve_no_icons\" data-css=\"tve-u-1798a39b87f\" data-element-name=\"Heading Level 3\" data-tag=\"H5\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1621521414279\" jump-animation=\"smooth\">Test script code<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level2 tve_no_icons\" data-css=\"tve-u-1798a39b87f\" data-element-name=\"Heading Level 3\" data-tag=\"H5\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1621521414280\" jump-animation=\"smooth\">Pom.xml<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level2 tve_no_icons\" data-css=\"tve-u-1798a39b87f\" data-element-name=\"Heading Level 3\" data-tag=\"H5\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1621521414281\" jump-animation=\"smooth\">TestNG_exclude.xml<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level2 tve_no_icons\" data-css=\"tve-u-1798a39b87f\" data-element-name=\"Heading Level 3\" data-tag=\"H5\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1621521414282\" jump-animation=\"smooth\">TestNG_group.xml<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level2 tve_no_icons\" data-css=\"tve-u-1798a39b87f\" data-element-name=\"Heading Level 3\" data-tag=\"H5\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1621521414283\" jump-animation=\"smooth\">TestNG_include.xml<\/a><\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv-divider tve-vert-divider\" data-color-d=\"rgb(217, 217, 217)\" data-style=\"tve_sep-1\">\n<hr class=\"tve_sep tve_sep-1\" style=\"\"\/><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 class=\"\" id=\"t-1621521414276\"><strong>TestNG Groups with Example<\/strong><\/h3>\n<p>We use groups in<u>\u00a0<\/u><strong>Testng<u> <\/u><\/strong>when,<\/p>\n<ul>\n<li>We don&#8217;t want to define test methods separately in different classes (depending upon functionality) and<\/li>\n<li>At the same time want to ignore (not to execute) some test cases as if they does not exist in the code.<\/li>\n<li>So to carry out this we have to Group them. This is done by using &#8220;include&#8221; and &#8220;exclude&#8221; mechanism supported in testNG.<\/li>\n<\/ul>\n<p>In below example, we have shown the syntax of how to use groups in the XML file.<\/p>\n<p><em><strong>@Test (groups = { &#8220;mobile TC&#8221;, &#8220;browser TC&#8221; }) <\/strong><\/em>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<\/p>\n<p>Here we are using 2 group names i.e. &#8220;bonding&#8221; and &#8220;strong_ties&#8221; (these are logical name that can be altered as per your wish).<\/p>\n<p><strong>&lt;groups&gt; tag<\/strong> defines the starting of groups in XML.<\/p>\n<p>Customize your XML to pick the mentioned group from the test classes. Below mentioned is the syntax of how to declare groups in XML file e.g.<\/p>\n<p><em><strong>&lt;groups&gt;<br \/>&lt;run&gt;<br \/>&lt;include name=&#8221; mobile TC &#8221; \/&gt;<br \/>&lt;\/run&gt;<br \/>&lt;\/groups&gt;<\/strong><\/em><em><strong><\/strong><\/em><\/p>\n<p>So, let us assume that there are 10 test methods in a class.<\/p>\n<p>Out of them,<\/p>\n<ul>\n<li>6 methods are tagged in &#8221; mobile TC &#8221; group and<\/li>\n<li>4 are in &#8221; browser TC &#8221; group.<\/li>\n<\/ul>\n<h3 class=\"\" id=\"t-1621521414277\"><strong>Introduction to XML and how to make an XML files<\/strong><\/h3>\n<ul>\n<li>XML (Extensible Markup Language) file in Maven framework contains the information of one or more tests and is defined by the <strong>tag &lt;suite&gt;<\/strong>.<\/li>\n<li>Test information in XML is represented by <strong>tag &lt;test&gt;<\/strong> and can contain one or more TestNG classes.<\/li>\n<li>A Java class which contains <strong>@Test <\/strong>annotation above test methods is defined as TestNG methods.<\/li>\n<\/ul>\n<p>Multiple tags are used in a sequence to build a working testNG xml like &lt;suite&gt;, &lt;test&gt; and &lt;class&gt;<\/p>\n<ul>\n<li>First is &lt;suite&gt; tag, which holds a logical name which defines full information to testNG reported to generate execution report.<\/li>\n<li>Second is &lt;test name=&#8221;TestNG Demo&#8221;&gt;, note it is logical name which holds the information of test execution report like pass, fail, skip test cases and other information like total time for execution and group info<\/li>\n<li>Third is &lt;class name=&#8221;<strong>com.group.rahulshetty.TC_Class1<\/strong>&#8221; \/&gt;, com.group.guru99 is the package used, and Test Class name is TC_Class1.<\/li>\n<\/ul>\n<\/div>\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\">\n<div class=\"tve-content-box-background\" style=\"background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; --background-image:linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5))  !important; --background-size:auto auto  !important; --background-position:50% 50%  !important; --background-attachment:scroll  !important; --background-repeat:no-repeat  !important;\"><\/div>\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-1798a3ea4bf\" style=\"\">\n<p data-css=\"tve-u-1798a3edae3\" style=\"\">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<\/p>\n<p data-css=\"tve-u-1798a3edae5\" style=\"\">&lt;!DOCTYPE suite SYSTEM &#8220;http:\/\/testng.org\/testng-1.0.dtd&#8221;&gt;<\/p>\n<p data-css=\"tve-u-1798a3edae7\" style=\"\">&lt;suite name=&#8221;Suite&#8221;&gt;<\/p>\n<p data-css=\"tve-u-1798a3edae8\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;test name=&#8221; TestNG Demo&#8221;&gt;<\/p>\n<p data-css=\"tve-u-1798a3edae9\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;groups&gt;<\/p>\n<p data-css=\"tve-u-1798a3edaeb\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;run&gt;<\/p>\n<p data-css=\"tve-u-1798a3edaec\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;include name=&#8221;Mobile TC &#8220;\/&gt;<\/p>\n<p data-css=\"tve-u-1798a3edaed\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/run&gt;<\/p>\n<p data-css=\"tve-u-1798a3edaee\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/groups&gt;<\/p>\n<p data-css=\"tve-u-1798a3edaef\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;classes&gt;<\/p>\n<p data-css=\"tve-u-1798a3edaf1\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;class name=&#8221;com.group. rahulshetty.TC_Class1&#8243;\/&gt;<\/p>\n<p data-css=\"tve-u-1798a3edaf2\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/classes&gt;<\/p>\n<p data-css=\"tve-u-1798a3edaf3\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/test&gt;<\/p>\n<p data-css=\"tve-u-1798a3edaf4\" style=\"\">&lt;\/suite&gt;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 class=\"\" id=\"t-1621521414278\"><strong>Another mechanism instead of Grouping is &#8220;exclude&#8221; or &#8220;include&#8221; in test XML<\/strong><\/h3>\n<p>Suppose you are finding the usage of group mechanism complex then testNG XML facilitate the functionality to exclude\/include a test.<\/p>\n<pre><strong>Exclude Tag<\/strong>:\u00a0 Syntax for exclude tag &lt;exclude name=\"${TEST_CASE_NAME}\" \/&gt;<\/pre>\n<pre><strong>Include Tag<\/strong>:\u00a0 Syntax for include tag &lt;include name=\"${TEST_CASE_NAME}\" \/&gt;<\/pre>\n<p><strong>Note:<\/strong> We can include\/exclude multiple test cases once at a time, and it works with Groups as well.<\/p>\n<h5 class=\"\"><strong>Test script code<\/strong><\/h5>\n<\/div>\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\">\n<div class=\"tve-content-box-background\" style=\"background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; --background-image:linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5))  !important; --background-size:auto auto  !important; --background-position:50% 50%  !important; --background-attachment:scroll  !important; --background-repeat:no-repeat  !important;\"><\/div>\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-1798a3f99c7\" style=\"\">\n<p data-css=\"tve-u-1798a3ff780\" style=\"\"><strong>package<\/strong> com.group.rahulshetty;<\/p>\n<p data-css=\"tve-u-1798a3ff782\" style=\"\"><strong>import<\/strong> java.util.concurrent.TimeUnit;<\/p>\n<p data-css=\"tve-u-1798a3ff783\" style=\"\"><strong>import<\/strong> org.openqa.selenium.By;<\/p>\n<p data-css=\"tve-u-1798a3ff784\" style=\"\"><strong>import<\/strong> org.openqa.selenium.WebDriver;<\/p>\n<p data-css=\"tve-u-1798a3ff785\" style=\"\"><strong>import<\/strong> org.openqa.selenium.chrome.ChromeDriver;<\/p>\n<p data-css=\"tve-u-1798a3ff787\" style=\"\"><strong>import<\/strong> org.testng.Assert;<\/p>\n<p data-css=\"tve-u-1798a3ff788\" style=\"\"><strong>import<\/strong> org.testng.annotations.Test;<\/p>\n<p data-css=\"tve-u-1798a3ff789\" style=\"\"><strong>public<\/strong><br \/>\n<strong>class<\/strong> TestNGDemo {<\/p>\n<p data-css=\"tve-u-1798a3ff78a\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong>public<\/strong><br \/>\n<strong>static<\/strong><br \/>\n<strong>final<\/strong> WebDriver <strong><em>driver<\/em><\/strong> = <strong>new<\/strong> ChromeDriver();;<\/p>\n<p data-css=\"tve-u-1798a3ff78c\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 String browserHeading = &#8220;Practice Page&#8221;;<\/p>\n<p data-css=\"tve-u-1798a3ff78d\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/**<\/p>\n<p data-css=\"tve-u-1798a3ff78e\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0* This test case will initialize the webDriver<\/p>\n<p data-css=\"tve-u-1798a3ff78f\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0*<\/p>\n<p data-css=\"tve-u-1798a3ff790\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0*\/<\/p>\n<p data-css=\"tve-u-1798a3ff792\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 @Test(groups = { &#8220;mobile TC&#8221;, &#8220;browser TC&#8221; })<\/p>\n<p data-css=\"tve-u-1798a3ff793\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong>public<\/strong><br \/>\n<strong>void<\/strong> launchURL() {<\/p>\n<p data-css=\"tve-u-1798a3ff794\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong><em>driver<\/em><\/strong>.manage().window().maximize();<\/p>\n<p data-css=\"tve-u-1798a3ff795\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong><em>driver<\/em><\/strong>.manage().timeouts().implicitlyWait(20, TimeUnit.<strong><em>SECONDS<\/em><\/strong>);<\/p>\n<p data-css=\"tve-u-1798a3ff797\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong><em>driver<\/em><\/strong>.get(&#8220;https:\/\/rahulshettyacademy.com\/AutomationPractice\/&#8221;);<\/p>\n<p data-css=\"tve-u-1798a3ff798\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p data-css=\"tve-u-1798a3ff799\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/**<\/p>\n<p data-css=\"tve-u-1798a3ff79a\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0* Will check the presence of Heading on home Page<\/p>\n<p data-css=\"tve-u-1798a3ff79b\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0*\/<\/p>\n<p data-css=\"tve-u-1798a3ff79d\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 @Test(groups = { &#8220;mobile TC&#8221; })<\/p>\n<p data-css=\"tve-u-1798a3ff79e\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong>public<\/strong><br \/>\n<strong>void<\/strong> verifyLaunchPage() {<\/p>\n<p data-css=\"tve-u-1798a3ff79f\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Assert.<em>assertTrue<\/em>(<strong><em>driver<\/em><\/strong>.findElement(By.<em>xpath<\/em>(browserHeading)).isDisplayed(),<\/p>\n<p data-css=\"tve-u-1798a3ff7a1\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;Home Page heading is displayed&#8221;);<\/p>\n<p data-css=\"tve-u-1798a3ff7a2\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 System.<strong><em>out<\/em><\/strong>.println(&#8220;Home Page heading is displayed&#8221;);<\/p>\n<p data-css=\"tve-u-1798a3ff7a3\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p data-css=\"tve-u-1798a3ff7a4\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/**<\/p>\n<p data-css=\"tve-u-1798a3ff7a6\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0* To click on radio button<\/p>\n<p data-css=\"tve-u-1798a3ff7a7\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0*\/<\/p>\n<p data-css=\"tve-u-1798a3ff7a8\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 @Test(groups = { &#8220;browser TC&#8221; })<\/p>\n<p data-css=\"tve-u-1798a3ff7a9\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong>public<\/strong><br \/>\n<strong>void<\/strong> clickRadioButton() {<\/p>\n<p data-css=\"tve-u-1798a3ff7aa\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong><em>driver<\/em><\/strong>.findElement(By.<em>xpath<\/em>(&#8220;\/\/input[@value=&#8217;radio1&#8242;]&#8221;)).click();<\/p>\n<p data-css=\"tve-u-1798a3ff7ac\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 System.<strong><em>out<\/em><\/strong>.println(&#8220;Radio Button clicked&#8221;);<\/p>\n<p data-css=\"tve-u-1798a3ff7ad\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p data-css=\"tve-u-1798a3fc98f\" style=\"\">}<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h5 class=\"\"><strong>Pom.xml<\/strong><\/h5>\n<\/div>\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\">\n<div class=\"tve-content-box-background\" style=\"background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; --background-image:linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5))  !important; --background-size:auto auto  !important; --background-position:50% 50%  !important; --background-attachment:scroll  !important; --background-repeat:no-repeat  !important;\"><\/div>\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-1798a408869\" style=\"\">\n<p data-css=\"tve-u-1798a40e493\" style=\"\">&lt;project xmlns=<em>&#8220;http:\/\/maven.apache.org\/POM\/4.0.0&#8221;<\/em> xmlns:xsi=<em>&#8220;http:\/\/www.w3.org\/2001\/XMLSchema-instance&#8221;<\/em><\/p>\n<p data-css=\"tve-u-1798a40e496\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 xsi:schemaLocation=<em>&#8220;http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd&#8221;<\/em>&gt;<\/p>\n<p data-css=\"tve-u-1798a40e497\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;<\/p>\n<p data-css=\"tve-u-1798a40e499\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;groupId&gt;GroupTestNG&lt;\/groupId&gt;<\/p>\n<p data-css=\"tve-u-1798a40e49a\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;artifactId&gt;GroupTestNG&lt;\/artifactId&gt;<\/p>\n<p data-css=\"tve-u-1798a40e49c\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;<\/p>\n<p data-css=\"tve-u-1798a40e49d\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;build&gt;<\/p>\n<p data-css=\"tve-u-1798a40e49f\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;sourceDirectory&gt;src&lt;\/sourceDirectory&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4a0\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;plugins&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4a1\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;plugin&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4a3\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;artifactId&gt;maven-compiler-plugin&lt;\/artifactId&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4a4\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;version&gt;3.3&lt;\/version&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4a5\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;configuration&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4a7\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;source&gt;1.7&lt;\/source&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4a8\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;target&gt;1.7&lt;\/target&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4a9\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/configuration&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4ab\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/plugin&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4ac\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/plugins&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4ad\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/build&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4af\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;dependencies&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4b0\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;dependency&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4b1\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;groupId&gt;org.seleniumhq.selenium&lt;\/groupId&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4b3\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;artifactId&gt;selenium-java&lt;\/artifactId&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4b4\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;version&gt;2.48.2&lt;\/version&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4b5\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/dependency&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4b7\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/dependencies&gt;<\/p>\n<p data-css=\"tve-u-1798a40e4b8\" style=\"\">&lt;\/project&gt;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h5 class=\"\"><strong>TestNG_exclude.xml<\/strong><\/h5>\n<\/div>\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\">\n<div class=\"tve-content-box-background\" style=\"background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; --background-image:linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5))  !important; --background-size:auto auto  !important; --background-position:50% 50%  !important; --background-attachment:scroll  !important; --background-repeat:no-repeat  !important;\"><\/div>\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-1798a413cfd\" style=\"\">\n<p data-css=\"tve-u-1798a418533\" style=\"\">&lt;?xml version=<em>&#8220;1.0&#8221;<\/em> encoding=<em>&#8220;UTF-8&#8221;<\/em> ?&gt;<\/p>\n<p data-css=\"tve-u-1798a418535\" style=\"\">&lt;!DOCTYPE suite SYSTEM &#8220;http:\/\/testng.org\/testng-1.0.dtd&#8221;&gt;<\/p>\n<p data-css=\"tve-u-1798a418537\" style=\"\">&lt;suite name=<em>&#8220;Suite&#8221;<\/em>&gt;<\/p>\n<p data-css=\"tve-u-1798a418538\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;test name=<em>&#8220;Rahul Shetty Smoke test&#8221;<\/em>&gt;<\/p>\n<p data-css=\"tve-u-1798a41853a\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;classes&gt;<\/p>\n<p data-css=\"tve-u-1798a41853b\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;class name=<em>&#8220;com.group.rahulshetty.TestNGDemo.java&#8221;<\/em>&gt;<\/p>\n<p data-css=\"tve-u-1798a41853c\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;methods&gt;<\/p>\n<p data-css=\"tve-u-1798a41853e\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;exclude name=<em>&#8220;verifyLaunchPage&#8221;<\/em>&gt;&lt;\/exclude&gt;<\/p>\n<p data-css=\"tve-u-1798a41853f\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/methods&gt;<\/p>\n<p data-css=\"tve-u-1798a418540\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/class&gt;<\/p>\n<p data-css=\"tve-u-1798a418541\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/classes&gt;<\/p>\n<p data-css=\"tve-u-1798a418543\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/test&gt;<\/p>\n<p data-css=\"tve-u-1798a418544\" style=\"\">&lt;\/suite&gt;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h5 class=\"\"><strong>TestNG_group.xml<\/strong><\/h5>\n<\/div>\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\">\n<div class=\"tve-content-box-background\" style=\"background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; --background-image:linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5))  !important; --background-size:auto auto  !important; --background-position:50% 50%  !important; --background-attachment:scroll  !important; --background-repeat:no-repeat  !important;\"><\/div>\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-1798a41d5ab\" style=\"\">\n<p data-css=\"tve-u-1798a421da5\" style=\"\">&lt;?xml version=<em>&#8220;1.0&#8221;<\/em> encoding=<em>&#8220;UTF-8&#8221;<\/em> ?&gt;<\/p>\n<p data-css=\"tve-u-1798a421da7\" style=\"\">&lt;!DOCTYPE suite SYSTEM &#8220;http:\/\/testng.org\/testng-1.0.dtd&#8221;&gt;<\/p>\n<p data-css=\"tve-u-1798a421da9\" style=\"\">&lt;suite name=<em>&#8220;Suite&#8221;<\/em>&gt;<\/p>\n<p data-css=\"tve-u-1798a421daa\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;test name=<em>&#8220;Rahul Shetty Smoke Test Demo&#8221;<\/em>&gt;<\/p>\n<p data-css=\"tve-u-1798a421dab\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;!&#8211; &lt;groups&gt;<\/p>\n<p data-css=\"tve-u-1798a421dac\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;run&gt;<\/p>\n<p data-css=\"tve-u-1798a421dae\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;include name=&#8221;mobile TC&#8221; \/&gt;<\/p>\n<p data-css=\"tve-u-1798a421daf\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/run&gt;<\/p>\n<p data-css=\"tve-u-1798a421db0\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/groups&gt; &#8211;&gt;<\/p>\n<p data-css=\"tve-u-1798a421db2\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/p>\n<p data-css=\"tve-u-1798a421db3\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;!&#8211; currently group is commented &#8211;&gt;<\/p>\n<p data-css=\"tve-u-1798a421db4\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;classes&gt;<\/p>\n<p data-css=\"tve-u-1798a421db5\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;class name=<em>&#8220;com.group.rahulshetty.TestNGDemo.java&#8221;<\/em> \/&gt;<\/p>\n<p data-css=\"tve-u-1798a421db7\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/classes&gt;<\/p>\n<p data-css=\"tve-u-1798a421db8\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/test&gt;<\/p>\n<p data-css=\"tve-u-1798a421db9\" style=\"\">&lt;\/suite&gt;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h5 class=\"\"><strong>TestNG_include.xml<\/strong><\/h5>\n<\/div>\n<div class=\"thrv_wrapper thrv_contentbox_shortcode thrv-content-box tve-elem-default-pad\">\n<div class=\"tve-content-box-background\" style=\"background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)) !important; background-size: auto !important; background-position: 50% 50% !important; background-attachment: scroll !important; background-repeat: no-repeat !important; --background-image:linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5))  !important; --background-size:auto auto  !important; --background-position:50% 50%  !important; --background-attachment:scroll  !important; --background-repeat:no-repeat  !important;\"><\/div>\n<div class=\"tve-cb\">\n<div class=\"thrv_wrapper thrv_text_element\" data-css=\"tve-u-1798a426aca\" style=\"\">\n<p data-css=\"tve-u-1798a42c8be\" style=\"\">&lt;?xml version=<em>&#8220;1.0&#8221;<\/em> encoding=<em>&#8220;UTF-8&#8221;<\/em> ?&gt;<\/p>\n<p data-css=\"tve-u-1798a42c8c0\" style=\"\">&lt;!DOCTYPE suite SYSTEM &#8220;http:\/\/testng.org\/testng-1.0.dtd&#8221;&gt;<\/p>\n<p data-css=\"tve-u-1798a42c8c1\" style=\"\">&lt;suite name=<em>&#8220;Suite&#8221;<\/em>&gt;<\/p>\n<p data-css=\"tve-u-1798a42c8c3\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;test name=<em>&#8220;Rahul Shetty Regression Test Demo&#8221;<\/em>&gt;<\/p>\n<p data-css=\"tve-u-1798a42c8c4\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;classes&gt;<\/p>\n<p data-css=\"tve-u-1798a42c8c5\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;class name=<em>&#8220;com.group.rahulshetty.TestNGDemo.java&#8221;<\/em>&gt;<\/p>\n<p data-css=\"tve-u-1798a42c8c6\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;methods&gt;<\/p>\n<p data-css=\"tve-u-1798a42c8c8\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;include name=<em>&#8220;launchURL&#8221;<\/em>&gt;&lt;\/include&gt;<\/p>\n<p data-css=\"tve-u-1798a42c8c9\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;include name=<em>&#8220;verifyLaunchPage&#8221;<\/em>&gt;&lt;\/include&gt;<\/p>\n<p data-css=\"tve-u-1798a42c8ca\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;include name=<em>&#8220;clickRadioButton&#8221;<\/em>&gt;&lt;\/include&gt;<\/p>\n<p data-css=\"tve-u-1798a42c8cb\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/methods&gt;<\/p>\n<p data-css=\"tve-u-1798a42c8cd\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/class&gt;<\/p>\n<p data-css=\"tve-u-1798a42c8ce\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/classes&gt;<\/p>\n<p data-css=\"tve-u-1798a42c8cf\" style=\"\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/test&gt;<\/p>\n<p data-css=\"tve-u-1798a42ac91\" style=\"\">&lt;\/suite&gt;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<p>If we consider above code we have learned that we can include and exclude or group test cases based on our requirement, using TestNG XML we can created test groups for sanity testing, smoke testing and regression testing.<\/p>\n<p>The above code can also be found below.<\/p>\n<p><span style=\"text-decoration: underline;\"><a class=\"tve-froala\" href=\"https:\/\/rahulshettyacademy.com\/blog\/wp-content\/uploads\/2021\/05\/GroupTestNG.zip\" style=\"outline: none;\" target=\"_blank\">GroupTestNG.zip<\/a><\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb_flag\" style=\"display: none\"><\/div>\n<p><!-- AI CONTENT END 1 --><br \/>\n<\/section>\n<p><\/body><\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>TestNG is a Testing framework that covers different types of test designs like unit, functional, end to end, UI and integration test. You can run a single or multiple packages (package here means to encapsulate a group of classes in a proper director format) by creating XML and run it through maven. table of contents [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3],"tags":[],"class_list":["post-386","post","type-post","status-publish","format-standard","hentry","category-selenium","category-testng","post-wrapper","thrv_wrapper"],"_links":{"self":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/wp-json\/wp\/v2\/posts\/386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/wp-json\/wp\/v2\/comments?post=386"}],"version-history":[{"count":0,"href":"https:\/\/rahulshettyacademy.com\/blog\/wp-json\/wp\/v2\/posts\/386\/revisions"}],"wp:attachment":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/wp-json\/wp\/v2\/media?parent=386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/wp-json\/wp\/v2\/categories?post=386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/wp-json\/wp\/v2\/tags?post=386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}