Page tree
Skip to end of metadata
Go to start of metadata

We provide you with Native integration into the TestNG testing framework.

Getting Started

Integrate to TestNG using 4 simple tests:

  1. Add the manager-client.jar to your project
  2. Add @Listeners annotation
  3. Add Reporter Server URL
  4. Create new ManagerPublisher

    That's it.
    Use the created instance to report tags and files.
    The listener will automatically extract as much data as possible for you.

Capabilities

  • Automatically capture the output, trace, and stacktraces and adds them to the test
  • Add attachments (PDF, HTML reports) to the test
  • Add test tags


Simple Example
import com.experitest.manager.api.ManagerPublisher;
import com.experitest.manager.client.PManager;
import com.experitest.manager.testng.ManagerTestNGListener;
import org.testng.annotations.*;

import java.io.File;
import java.lang.reflect.Method;

@Listeners(ManagerTestNGListener.class)
public class SimpleExampleTestNG {

	static {
    	System.setProperty("manager.url", "localhost:9011");
        System.setProperty("manager.url", "<Cloud url>:<reverse proxy port>/reporter");// in case using Reporter that configure to a single port cloud
		System.setProperty("manager.accesskey", "accesskey"); // in case using Reporter that configure to a cloud
	}

	private ManagerPublisher managerPublisher = null;
	
    @BeforeMethod
    public void setup(Method method){

        // Init the managerPublisher in the before method section
        managerPublisher = PManager.createManagerPublisher(method.getName());
    }

    @Test
    public void simpleTest() {

        // Test goes here

        // Add key value tag
        managerPublisher.addProperty("team", "automation");
    }

    @AfterMethod
    public void tearDown() {

        // Add custom report folder
        managerPublisher.addReportFolder(new File("//path//to//file"));
    }
}