{"id":890,"date":"2019-12-06T13:49:54","date_gmt":"2019-12-06T08:19:54","guid":{"rendered":"http:\/\/http:\/\/artoftesting.com\/\/?p=890"},"modified":"2023-04-27T14:30:28","modified_gmt":"2023-04-27T09:00:28","slug":"testng-tutorial","status":"publish","type":"post","link":"https:\/\/artoftesting.com\/testng-tutorial","title":{"rendered":"TestNG Tutorial"},"content":{"rendered":"\n<p>TestNG is one of the most widely used open-source testing frameworks. In this tutorial, we will learn about different features of testNG &#8211; data driven testing implementation, <a href=\"http:\/\/artoftesting.com\/parameterization\">parameterization<\/a> support, different utility annotations and test case grouping that aid in creating robust and powerful testing frameworks.<br><\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-flat ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\"><p class=\"ez-toc-title\" style=\"cursor:inherit\">Content<\/p>\n<\/div><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/artoftesting.com\/testng-tutorial\/#TestNG_With_Selenium_Tutorial\" title=\"TestNG With Selenium Tutorial\">TestNG With Selenium Tutorial<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/artoftesting.com\/testng-tutorial\/#TestNG_Interview_Questions\" title=\"TestNG Interview Questions\">TestNG Interview Questions<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"TestNG_With_Selenium_Tutorial\"><\/span>TestNG With Selenium Tutorial<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"http:\/\/artoftesting.com\/what-is-testng\">TestNG Introduction<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/artoftesting.com\/seleniumsamplescript\">Selenium Webdriver with TestNG Sample Script<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/artoftesting.com\/testng-annotations\">TestNG Annotations<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/artoftesting.com\/data-driven-framework-in-selenium-using-testng\">Data Driven Testing in TestNG<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/artoftesting.com\/rerun-failed-tests-in-testng-selenium-webdriver-java\">Rerun failed test in TestNG<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/artoftesting.com\/run-selenium-test-in-parallel\">Running Selenium Tests in Parallel using TestNG<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/artoftesting.com\/multi-browser-testing-in-selenium\">Multi-browser testing in Selenium using TestNG<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/artoftesting.com\/test-priority-in-testng-selenium-webdriver-java\">Set Test priority in TestNG<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/artoftesting.com\/dependsonmethods-in-testng-selenium-webdriver-with-java\">Dependency in Tests<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/artoftesting.com\/soft-assertion-in-testng-selenium-webdriver-java\">Soft Assertion in TestNG<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/artoftesting.com\/timeout-in-testng-selenium-webdriver-java\">Timeouts in TestNG<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"TestNG_Interview_Questions\"><\/span>TestNG Interview Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"http:\/\/artoftesting.com\/testng-interview-questions-with-answers\">TestNG Interview Questions<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>TestNG is one of the most widely used open-source testing frameworks. In this tutorial, we will learn about different features of testNG &ndash; data driven testing implementation, parameterization support, different utility annotations and test case grouping that aid in creating robust and powerful testing frameworks. TestNG With Selenium Tutorial TestNG Interview Questions<\/p>\n","protected":false},"author":1,"featured_media":1514,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-890","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-testng"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>TestNG with Java Tutorials for Beginners<\/title>\n<meta name=\"description\" content=\"Free TestNG tutorials for beginners. Learn TestNG with Selenium WebDriver in Java using examples and sample scripts.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/artoftesting.com\/testng-tutorial\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TestNG with Java Tutorials for Beginners\" \/>\n<meta property=\"og:description\" content=\"Free TestNG tutorials for beginners. Learn TestNG with Selenium WebDriver in Java using examples and sample scripts.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/artoftesting.com\/testng-tutorial\" \/>\n<meta property=\"og:site_name\" content=\"ArtOfTesting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/artoftesting\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-06T08:19:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-27T09:00:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/TestNG-Tutorial.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"700\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Kuldeep Rana\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@theartoftesting\" \/>\n<meta name=\"twitter:site\" content=\"@theartoftesting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kuldeep Rana\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/artoftesting.com\/testng-tutorial#article\",\"isPartOf\":{\"@id\":\"https:\/\/artoftesting.com\/testng-tutorial\"},\"author\":{\"name\":\"Kuldeep Rana\",\"@id\":\"https:\/\/artoftesting.com\/#\/schema\/person\/7846d06225b52c778d160becf65996a5\"},\"headline\":\"TestNG Tutorial\",\"datePublished\":\"2019-12-06T08:19:54+00:00\",\"dateModified\":\"2023-04-27T09:00:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/artoftesting.com\/testng-tutorial\"},\"wordCount\":105,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/artoftesting.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/artoftesting.com\/testng-tutorial#primaryimage\"},\"thumbnailUrl\":\"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/TestNG-Tutorial.jpg\",\"articleSection\":[\"TestNG\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/artoftesting.com\/testng-tutorial#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/artoftesting.com\/testng-tutorial\",\"url\":\"https:\/\/artoftesting.com\/testng-tutorial\",\"name\":\"TestNG with Java Tutorials for Beginners\",\"isPartOf\":{\"@id\":\"https:\/\/artoftesting.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/artoftesting.com\/testng-tutorial#primaryimage\"},\"image\":{\"@id\":\"https:\/\/artoftesting.com\/testng-tutorial#primaryimage\"},\"thumbnailUrl\":\"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/TestNG-Tutorial.jpg\",\"datePublished\":\"2019-12-06T08:19:54+00:00\",\"dateModified\":\"2023-04-27T09:00:28+00:00\",\"description\":\"Free TestNG tutorials for beginners. Learn TestNG with Selenium WebDriver in Java using examples and sample scripts.\",\"breadcrumb\":{\"@id\":\"https:\/\/artoftesting.com\/testng-tutorial#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/artoftesting.com\/testng-tutorial\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/artoftesting.com\/testng-tutorial#primaryimage\",\"url\":\"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/TestNG-Tutorial.jpg\",\"contentUrl\":\"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/TestNG-Tutorial.jpg\",\"width\":700,\"height\":400,\"caption\":\"TestNG Tutorial\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/artoftesting.com\/testng-tutorial#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/artoftesting.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automation Testing\",\"item\":\"https:\/\/artoftesting.com\/category\/automation-testing\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"TestNG\",\"item\":\"https:\/\/artoftesting.com\/category\/automation-testing\/testng\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"TestNG Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/artoftesting.com\/#website\",\"url\":\"https:\/\/artoftesting.com\/\",\"name\":\"ArtOfTesting\",\"description\":\"A Beginners Guide to Testing\",\"publisher\":{\"@id\":\"https:\/\/artoftesting.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/artoftesting.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/artoftesting.com\/#organization\",\"name\":\"ArtOfTesting\",\"url\":\"https:\/\/artoftesting.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/artoftesting.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Artoftesting_logo.png\",\"contentUrl\":\"http:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Artoftesting_logo.png\",\"width\":400,\"height\":60,\"caption\":\"ArtOfTesting\"},\"image\":{\"@id\":\"https:\/\/artoftesting.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/artoftesting\",\"https:\/\/x.com\/theartoftesting\",\"https:\/\/www.linkedin.com\/groups\/4797819\/\",\"https:\/\/in.pinterest.com\/artoftesting\/\",\"https:\/\/www.youtube.com\/channel\/UCQ9PUVenvvyrUdDQ9yKn31Q\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/artoftesting.com\/#\/schema\/person\/7846d06225b52c778d160becf65996a5\",\"name\":\"Kuldeep Rana\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/artoftesting.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cb5979a4b81ca7739c75080e473fad391a8665364e72abaddec9002dd4553326?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cb5979a4b81ca7739c75080e473fad391a8665364e72abaddec9002dd4553326?s=96&d=mm&r=g\",\"caption\":\"Kuldeep Rana\"},\"description\":\"Kuldeep is the founder and lead author of ArtOfTesting. He is skilled in test automation, performance testing, big data, and CI-CD. He brings his decade of experience to his current role where he is dedicated to educating the QA professionals.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"TestNG with Java Tutorials for Beginners","description":"Free TestNG tutorials for beginners. Learn TestNG with Selenium WebDriver in Java using examples and sample scripts.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/artoftesting.com\/testng-tutorial","og_locale":"en_US","og_type":"article","og_title":"TestNG with Java Tutorials for Beginners","og_description":"Free TestNG tutorials for beginners. Learn TestNG with Selenium WebDriver in Java using examples and sample scripts.","og_url":"https:\/\/artoftesting.com\/testng-tutorial","og_site_name":"ArtOfTesting","article_publisher":"https:\/\/facebook.com\/artoftesting","article_published_time":"2019-12-06T08:19:54+00:00","article_modified_time":"2023-04-27T09:00:28+00:00","og_image":[{"width":700,"height":400,"url":"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/TestNG-Tutorial.jpg","type":"image\/jpeg"}],"author":"Kuldeep Rana","twitter_card":"summary_large_image","twitter_creator":"@theartoftesting","twitter_site":"@theartoftesting","twitter_misc":{"Written by":"Kuldeep Rana","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/artoftesting.com\/testng-tutorial#article","isPartOf":{"@id":"https:\/\/artoftesting.com\/testng-tutorial"},"author":{"name":"Kuldeep Rana","@id":"https:\/\/artoftesting.com\/#\/schema\/person\/7846d06225b52c778d160becf65996a5"},"headline":"TestNG Tutorial","datePublished":"2019-12-06T08:19:54+00:00","dateModified":"2023-04-27T09:00:28+00:00","mainEntityOfPage":{"@id":"https:\/\/artoftesting.com\/testng-tutorial"},"wordCount":105,"commentCount":2,"publisher":{"@id":"https:\/\/artoftesting.com\/#organization"},"image":{"@id":"https:\/\/artoftesting.com\/testng-tutorial#primaryimage"},"thumbnailUrl":"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/TestNG-Tutorial.jpg","articleSection":["TestNG"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/artoftesting.com\/testng-tutorial#respond"]}]},{"@type":"WebPage","@id":"https:\/\/artoftesting.com\/testng-tutorial","url":"https:\/\/artoftesting.com\/testng-tutorial","name":"TestNG with Java Tutorials for Beginners","isPartOf":{"@id":"https:\/\/artoftesting.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/artoftesting.com\/testng-tutorial#primaryimage"},"image":{"@id":"https:\/\/artoftesting.com\/testng-tutorial#primaryimage"},"thumbnailUrl":"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/TestNG-Tutorial.jpg","datePublished":"2019-12-06T08:19:54+00:00","dateModified":"2023-04-27T09:00:28+00:00","description":"Free TestNG tutorials for beginners. Learn TestNG with Selenium WebDriver in Java using examples and sample scripts.","breadcrumb":{"@id":"https:\/\/artoftesting.com\/testng-tutorial#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/artoftesting.com\/testng-tutorial"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/artoftesting.com\/testng-tutorial#primaryimage","url":"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/TestNG-Tutorial.jpg","contentUrl":"https:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/TestNG-Tutorial.jpg","width":700,"height":400,"caption":"TestNG Tutorial"},{"@type":"BreadcrumbList","@id":"https:\/\/artoftesting.com\/testng-tutorial#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/artoftesting.com\/"},{"@type":"ListItem","position":2,"name":"Automation Testing","item":"https:\/\/artoftesting.com\/category\/automation-testing"},{"@type":"ListItem","position":3,"name":"TestNG","item":"https:\/\/artoftesting.com\/category\/automation-testing\/testng"},{"@type":"ListItem","position":4,"name":"TestNG Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/artoftesting.com\/#website","url":"https:\/\/artoftesting.com\/","name":"ArtOfTesting","description":"A Beginners Guide to Testing","publisher":{"@id":"https:\/\/artoftesting.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/artoftesting.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/artoftesting.com\/#organization","name":"ArtOfTesting","url":"https:\/\/artoftesting.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/artoftesting.com\/#\/schema\/logo\/image\/","url":"http:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Artoftesting_logo.png","contentUrl":"http:\/\/artoftesting.com\/wp-content\/uploads\/2019\/12\/Artoftesting_logo.png","width":400,"height":60,"caption":"ArtOfTesting"},"image":{"@id":"https:\/\/artoftesting.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/artoftesting","https:\/\/x.com\/theartoftesting","https:\/\/www.linkedin.com\/groups\/4797819\/","https:\/\/in.pinterest.com\/artoftesting\/","https:\/\/www.youtube.com\/channel\/UCQ9PUVenvvyrUdDQ9yKn31Q"]},{"@type":"Person","@id":"https:\/\/artoftesting.com\/#\/schema\/person\/7846d06225b52c778d160becf65996a5","name":"Kuldeep Rana","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/artoftesting.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cb5979a4b81ca7739c75080e473fad391a8665364e72abaddec9002dd4553326?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cb5979a4b81ca7739c75080e473fad391a8665364e72abaddec9002dd4553326?s=96&d=mm&r=g","caption":"Kuldeep Rana"},"description":"Kuldeep is the founder and lead author of ArtOfTesting. He is skilled in test automation, performance testing, big data, and CI-CD. He brings his decade of experience to his current role where he is dedicated to educating the QA professionals."}]}},"_links":{"self":[{"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/posts\/890","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/comments?post=890"}],"version-history":[{"count":1,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/posts\/890\/revisions"}],"predecessor-version":[{"id":6770,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/posts\/890\/revisions\/6770"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/media\/1514"}],"wp:attachment":[{"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/media?parent=890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/categories?post=890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artoftesting.com\/wp-json\/wp\/v2\/tags?post=890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}