TestNG Tutorials 61: Dependency in TestNG – Creating Dependency Among Test Methods – DependsOnGroup

In previous post, We have learnt to Establish dependency among test methods. In this post, we will see another concept in Dependency called DependsOnGroup. Consider a scenario: You have created automation scripts for Integration testing. We know that in integration testing, data flows from one module to another. You divide your test methods as per group. … Continue reading TestNG Tutorials 61: Dependency in TestNG – Creating Dependency Among Test Methods – DependsOnGroup

TestNG Tutorials 60: Dependency in TestNG – Creating Dependency Among Test Methods – DependsOnMethod

We are going to see another important concept or feature provided by TestNG. This feature is called as Dependency. Suppose, we need to post a status on Facebook. Let's write a Test Case for it: Step 1: Launch browser. Step 2: Launch Facebook url. Step 3: Create an account on Facebook. Step 4: Post a … Continue reading TestNG Tutorials 60: Dependency in TestNG – Creating Dependency Among Test Methods – DependsOnMethod

TestNG Tutorials 59: DataProvider in TestNG – Running DataProvider Method in Parallel – Parallel DataProvider Method

A Test method is run for all data set provided by a DataProvider method which is by default one after another. Note here that test method is run on data in same sequence in which DataProvider pass it. The reason behind this is that a DataProvider annotated method has an attribute named “parallel” whose default … Continue reading TestNG Tutorials 59: DataProvider in TestNG – Running DataProvider Method in Parallel – Parallel DataProvider Method

TestNG Tutorials 58: DataProvider in TestNG – Running Test for Specific Set of Data Provided by DataProvider Method – Dataprovider With Indices

By default a Test method is executed for all data set returned by DataProvider. The reason behind this is that a DataProvider annotated method has an attribute called "indices" whose default value is set to "all". You may need to run only specific set of data. Like if DataProvider providing you five set of data … Continue reading TestNG Tutorials 58: DataProvider in TestNG – Running Test for Specific Set of Data Provided by DataProvider Method – Dataprovider With Indices

TestNG Tutorials 57: DataProvider in TestNG – Passing External Data File Name to DataProvider Method Using TestNG xml

In last post, we have learnt how can we make parameterized DataProvider method in TestNG to provide test data to multiple Test methods from single DataProvider method. Let's make it more customised. Suppose you need to read data from external file like Excel, properties file etc in a DataProvider method. The name of external file … Continue reading TestNG Tutorials 57: DataProvider in TestNG – Passing External Data File Name to DataProvider Method Using TestNG xml

TestNG Tutorials 56: DataProvider in TestNG – Parameterizing DataProvider Method to Provide Data to Multiple Test Methods

"DataProvider" is an important feature provided by TestNG to provide required test data to test methods to run on. We have learnt different approaches which we can utilize to get best of DataProvider in previous posts. Let's learn another way to make more use of DataProvider in TestNG. Suppose we have three Test methods and … Continue reading TestNG Tutorials 56: DataProvider in TestNG – Parameterizing DataProvider Method to Provide Data to Multiple Test Methods

Frequently Asked Java Program 23: Java Program to Remove Extra WhiteSpace Between Words In Given String

Problem Statement: Remove extra white spaces between words. Only one white space is allowed between words. If more than one, remove it. If given string has leading or trailing white spaces, remove them as well. Do not use trim method. Write your own logic. Example: You entered with spaces: "       Make      … Continue reading Frequently Asked Java Program 23: Java Program to Remove Extra WhiteSpace Between Words In Given String

Frequently Asked Java Program 22: Java Program to Trim Whitespace From String Without Using Trim Method

Hello Folks, This interview question was asked in Deloitte.  Write a java program to Trim a given string without using inbuilt trim() method of String Class in Java. "trim()" method of String class trims leading and trailing whitespace/s of given string. It does not remove whitespace between words. We need to write logic to do so. … Continue reading Frequently Asked Java Program 22: Java Program to Trim Whitespace From String Without Using Trim Method

TestNG Tutorials 55: DataProvider in TestNG – Lazy Initialisation of DataProvider Method – Use of Iterator Return Type

Hello, DataProvider is an important functionality provided by TestNG to achieve Data driven testing or providing a set of different dataset to a method to execute on. We have seen DataProvider concept in details in previous posts. DataProvider may become nightmare if number of data (arguments) is more or it keeps changing or you do not … Continue reading TestNG Tutorials 55: DataProvider in TestNG – Lazy Initialisation of DataProvider Method – Use of Iterator Return Type

TestNG Tutorials 54: DataProvider in TestNG – Implementing Object Oriented Concept “Encapsulation” with DataProvider Method

Hello Folks, As part of ongoing series on DataProvider, we will learn "How does Encapsulation ( in OOPS concept) help in a DataProvider method? " in this post. Encapsulation is an Object Oriented Programming concept which describes binding of related stuffs together under one roof. It makes easier to add , remove and modify members. For … Continue reading TestNG Tutorials 54: DataProvider in TestNG – Implementing Object Oriented Concept “Encapsulation” with DataProvider Method