Skip to main content

Extent Reports

 


1.      ExtentReports is an logger-style reporting library for automated tests.

2.      A logger is simply an object to log messages or events for a specific system or application.

3.      ExtentReports uses the logging style to add information about test sessions, such as creation of tests, adding screenshots, assigning tags, and adding events or series of steps to sequentially indicate the flow of test steps.

 

Extent Reports in Selenium contain two frequently used classes:

·        ExtentReports class

·        ExtentTest class

Syntax

ExtentReports reports = new ExtentReports("Path of directory to store the resultant HTML file", true/false);

ExtentTest test = reports.startTest("TestName");

 

Both classes can be used with the following built-in methods:

·        startTest: Executes preconditions of a test case

·        endTest: Executes postconditions of a test case

·        Log: Logs the status of each test step onto the HTML report being generated

·        Flush: Erases any previous data on a relevant report and creates a whole new report

A Test Status can be indicated by the following values:

·        PASS

·        FAIL

·        SKIP

·        INFO

Syntax:

test.log(LogStatus.PASS,”Test Passed”);

Maven Dependency:

<dependency>

                                             <groupId>com.relevantcodes</groupId>

                                             <artifactId>extentreports</artifactId>

                                             <version>2.41.2</version>

                              </dependency>


 

Benefits of Extent Reports:

  1.         They can be integrated with TestNG and Junit
  2.         screenshots can be captured and displayed for each step in a test
  3.         They show the time needed for test execution
  4.        They can be customized to graphically represent each step in a test.














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 : 

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 requests ov

Selenium introduction

Selenium introduction and its components: Selenium was created by Jason Huggins in 2004. An engineer at ThoughtWorks, he was working on a web application that required frequent testing. First tool was named as “JavaScriptTestRunner” later named as “Selenium Core” Selenium is a functional automation tool for web applications Selenium is an open-source Selenium can support multiple languages like HTML, java, python, ruby, Perl, PHP and C# Can support multiple browsers like IE, Google Chrome, Mozilla Firefox, Safari and Opera Supports the Operating systems like Windows, Linux, and Mac. Selenium is mainly built-in 4 Components Selenium IDE (Integrated Development Environment) Selenium RC (Remote Control) Selenium WebDriver Selenium Grid Selenium IDE (Integrated Development Environment): Selenium IDE is a simple record and playback tool which comes as an add-on for Mozilla Firefox only. Test cases written in IDE can be ex