Skip to main content

What is ISuiteListener In TestNG

 ISuiteListener is another type of listener provided in TestNG this listener works on the suite level.

ISuiteListener listens to the event of the start of a suite execution and end of the suite execution. 

ISuiteListener runs the methods only before the start of the suite and at the end. It contains two methods:

  • onStartThis method invokes before the test suite execution starts.
  • onFinishThis method invokes after the test suite execution ends.

 

One should note that if the parent suite contains child suites then the child suites are executed before the parent suite.


Code example:

package isuiteListener;

import org.testng.ISuite;

import org.testng.ISuiteListener;

public class ListenersTest implements ISuiteListener{

@Override

public void onStart(ISuite suite) {

// TODO Auto-generated method stub

System.out.println("this is on start function  "+suite.getName());

}

@Override

public void onFinish(ISuite suite) {

// TODO Auto-generated method stub

System.out.println("this is on finish function "+suite.getName());

}

}

Follow my session on YouTube



 

Comments

Popular posts from this blog

Java Program to Swap Two Numbers

In this program, you'll learn two techniques to swap two numbers in Java. The first one uses a temporary variable for swapping, while the second one doesn't use any temporary variables. To understand this example, you should have knowledge of the following Java programming topics: Basics of Java  Java Operators  Java Data types  Program with Temp Variable : The output of the program is : before swapping value of a:5 value of b:10 after swapping value of a:10 value of b:5 Program without temp variable :  the output of the above program will be: before swapping value of first:5 value of second:10 after swapping value of first:10 value of second:5 Follow my session on youtube : 

How to Write Test Cases in Manual Testing

Test Cases document: Test cases play important role during the application testing in software testing. Where each requirement is break down into multiple test scenarios and then after test cases.  here is the test case template, which is being followed by current software testing domain.  High level information:  Test Cases Break down based in the requirement.  For detail Explanation: refer the below video

Webservices Interview Questions

  1. What is Web Service The Web Service is a standard software system used for communication between two devices (client and server) over the network or Say exchanging information between two applications over the network. 2. How Does a Web Service Work? A web service enables communication among various applications by using open standards such as HTML, XML, WSDL, and SOAP. You can build a Java-based web service on Solaris that is accessible from your Visual Basic program that runs on Windows. 3. Explain web service architecture? Web service framework architecture consists of three different layers. Service Provider: Service provider role is to create the web service and makes it accessible to the client applications over the internet for their usage. Service Requestor: Service Requestor is basically any consumer of web service like any client application. Client applications are written in any language. They contact web service for any type of functionality by sending XML request...