Advanced TestNG Tutorials 34: How To Pass a Group Name to be Run at Runtime in TestNG XML Using Beanshell

Hello Folks, In last post, we have seen how integration of beanshell and TestNg can help us to achieve “AND” and “OR” conditions with group names to be executed. Problem statement: You have created so many test methods with different groups. You do not need to run all group every time. You need to include

Read More

TestNG Tutorials 29: Grouping Configuration Methods in TestNG

Hello Folks, In previous post, we learnt about basics of group concepts in TestNG and how to use with @Test annotated methods. In this method we will see how can we use grouping concept with configuration methods. Below are the configuration methods provided by TestNG: @BeforeSuite @AfterSuite @BeforeTest @AfterTest @BeforeGroups @AfterGroups @BeforeClass @AfterClass @BeforeMethod @AfterMethod

Read More

TestNG Tutorials 27: Usage of alwaysRun Attribute With Configuration Methods of TestNG

Hello Folks, In last post we learn usage of of alwaysRun Attribute With Test Method of TestNG. In this post, we will see usage of alwaysRun attribute with configuration method in TestNG. What is a Configuration Method in TestNG? When we mark a method as @BeforeXXXX or @AfterXXXX, that method is called as Configuration method. Example:

Read More

TestNG Tutorials 26: Understand Usage of alwaysRun Attribute With Test Method of TestNG

Hello Folks, In this post we will learn about “alwaysRun” attribute and its usage with @Test annotated method in TestNG. “alwaysRun” attribute can be used with Configuration methods(BeforeXXXX and @AfterXXXX) and Test methods(@Test). TestNG documentation defines alwaysRun attribute as: For configuration methods: For before methods (beforeSuite, beforeTest, beforeTestClass and beforeTestMethod, but not beforeGroups): If set to

Read More

TestNG Tutorials 24: Annotations In TestNG – A Quick Guide

Hello Folks, As part of learning TestNG step by step, I will list all available annotations of TestNG in this post and will see each and every annotations in details in later posts. As per TestNG documentation, TestNG provides you below annotations: @BeforeSuite @AfterSuite @BeforeTest @AfterTest @BeforeGroups @AfterGroups @BeforeClass @AfterClass @BeforeMethod @AfterMethod @DataProvider @Factory @Listeners

Read More

Please wait...

Subscribe to new posts to become automation expert

Want to be notified when my new post is published? Get my posts in your inbox.