<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Extents Reports - Java Archives | Selenium Webdriver Appium Complete Tutorial</title>
	<atom:link href="https://automationtesting.in/category/extents-reports-java/feed/" rel="self" type="application/rss+xml" />
	<link>https://automationtesting.in/category/extents-reports-java/</link>
	<description>Automation Testing</description>
	<lastBuildDate>Fri, 26 May 2017 11:48:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2.2</generator>
	<item>
		<title>Capture Screenshot in Extent Reports &#8211; Java</title>
		<link>https://automationtesting.in/capture-screenshot-in-extent-reports-java/</link>
					<comments>https://automationtesting.in/capture-screenshot-in-extent-reports-java/#comments</comments>
		
		<dc:creator><![CDATA[Krishna Sakinala]]></dc:creator>
		<pubDate>Thu, 08 Dec 2016 15:46:23 +0000</pubDate>
				<category><![CDATA[Extents Reports - Java]]></category>
		<category><![CDATA[capture screenshot in extent reports]]></category>
		<category><![CDATA[capture screenshot in selenium]]></category>
		<category><![CDATA[extent reports screenshot]]></category>
		<category><![CDATA[how to get screenshot in selenium]]></category>
		<category><![CDATA[report screenshot]]></category>
		<category><![CDATA[screenshot in extent reports]]></category>
		<category><![CDATA[screenshot in html report]]></category>
		<category><![CDATA[screenshot in report]]></category>
		<category><![CDATA[selenium reports]]></category>
		<category><![CDATA[selenium screenshot]]></category>
		<guid isPermaLink="false">http://automationtesting.in/?p=257</guid>

					<description><![CDATA[<p>Capture Screenshot in Extent Reports will discuss about capturing the screenshot of a particular failure step in the HTML report.  In our previous blog we have seen how to log the messages in the report. Same way here we will capture the screenshot for a particular failure step. The screenshot will give the information about [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://automationtesting.in/capture-screenshot-in-extent-reports-java/">Capture Screenshot in Extent Reports &#8211; Java</a> appeared first on <a rel="nofollow" href="https://automationtesting.in">Selenium Webdriver Appium Complete Tutorial</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img src='http://automationtesting.in/wp-content/uploads/2016/12/LOG-GENERATION-IN-EXTENT-REPORTS-JAVA-1.png'></p><p><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<!-- 800*100 --><br />
<ins class="adsbygoogle" style="display: inline-block; width: 800px; height: 100px;" data-ad-client="ca-pub-9173866185064071" data-ad-slot="9211570346"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
Capture Screenshot in Extent Reports will discuss about capturing the screenshot of a particular failure step in the HTML report.  In our previous blog we have seen how to log the messages in the report. Same way here we will capture the screenshot for a particular failure step. The screenshot will give the information about on which screen the script  got failed during the execution. Then we can easily identify the issue by looking into the report.</p>
<div class="post-video"><iframe loading="lazy" title="Capture Screenshot in Extent Reports – Selenium Webdriver Reports in Java" width="1165" height="655" src="https://www.youtube.com/embed/oldnIofnd4A?wmode=transparent&#038;fs=1"  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>
<p>For this we need to use the <strong>log()</strong> method of ExtentTest class. To log the screenshot in the report we need to pass the path of the screenshot to the log method as a parameter. So, before logging the screenshot to the report we need to capture the screenshot of that particular failure method and place it in a folder from there we need to get the path of the screenshot file and pass it to the log method.</p>
<p><strong>Below is the sample program to capture screenshot in the report:</strong></p>
<pre class="brush: java; highlight: [16,17,23,29,34,43,44,53,54]; title: ; notranslate">
import java.io.IOException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.Assert;
import org.testng.ITestResult;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import com.relevantcodes.extentreports.ExtentReports;
import com.relevantcodes.extentreports.ExtentTest;
import com.relevantcodes.extentreports.LogStatus;

public class CapturingScreenshot
{
    ExtentReports extent;
    ExtentTest test;
    WebDriver driver;
    
    @BeforeTest
    public void init()
    {
        extent = new ExtentReports(System.getProperty(&quot;user.dir&quot;) + &quot;/test-output/ExtentScreenshot.html&quot;, true);
    }
    
    @Test
    public void captureScreenshot()
    {
        test = extent.startTest(&quot;captureScreenshot&quot;);
        driver = new FirefoxDriver();
        driver.get(&quot;https://automationtesting.in&quot;);
        String title = driver.getTitle();
        Assert.assertEquals(&quot;Home - Automation Test&quot;, title);
        test.log(LogStatus.PASS, &quot;Test Passed&quot;);
    }
    
    @AfterMethod
    public void getResult(ITestResult result) throws IOException
    {
        if(result.getStatus() == ITestResult.FAILURE)
        {
            String screenShotPath = GetScreenShot.capture(driver, &quot;screenShotName&quot;);
            test.log(LogStatus.FAIL, result.getThrowable());
            test.log(LogStatus.FAIL, &quot;Snapshot below: &quot; + test.addScreenCapture(screenShotPath));
        }
        extent.endTest(test);
    }
    
        
    @AfterTest
    public void endreport()
    {
        driver.close();
        extent.flush();
        extent.close();
    }
}
</pre>
<p>In the above program we have written  test.log method to log the screenshot into the extent reports. This information will logged in the report with time stamp.<br />
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<!-- 800*100 --><br />
<ins class="adsbygoogle" style="display: inline-block; width: 800px; height: 100px;" data-ad-client="ca-pub-9173866185064071" data-ad-slot="9211570346"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
Below is the program to capture the screenshot and it will place the screenshot in a particular folder and will return the path of the screenshot. Will use that path to capture the screenshot in the HTML report for a failure step.</p>
<pre class="brush: java; highlight: [14,18]; title: ; notranslate">
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;

public class GetScreenShot {
    
    public static String capture(WebDriver driver,String screenShotName) throws IOException
    {
        TakesScreenshot ts = (TakesScreenshot)driver;
        File source = ts.getScreenshotAs(OutputType.FILE);
        String dest = System.getProperty(&quot;user.dir&quot;) +&quot;\\ErrorScreenshots\\&quot;+screenShotName+&quot;.png&quot;;
        File destination = new File(dest);
        FileUtils.copyFile(source, destination);        
                    
        return dest;
    }
}
</pre>
<p>Above program will return the path of the screenshot.</p>
<p><strong>Below is the output of the above program:</strong></p>
<p><a href="https://automationtesting.in/wp-content/uploads/2016/12/Capture-Screenshot-in-Extent-Reports.png"><img decoding="async" loading="lazy" class="alignnone size-full wp-image-258" src="https://automationtesting.in/wp-content/uploads/2016/12/Capture-Screenshot-in-Extent-Reports.png" alt="Capture Screenshot in Extent Reports" width="1366" height="683" srcset="https://automationtesting.in/wp-content/uploads/2016/12/Capture-Screenshot-in-Extent-Reports.png 1366w, https://automationtesting.in/wp-content/uploads/2016/12/Capture-Screenshot-in-Extent-Reports-300x150.png 300w, https://automationtesting.in/wp-content/uploads/2016/12/Capture-Screenshot-in-Extent-Reports-768x384.png 768w, https://automationtesting.in/wp-content/uploads/2016/12/Capture-Screenshot-in-Extent-Reports-1024x512.png 1024w" sizes="(max-width: 1366px) 100vw, 1366px" /></a></p>
<p>Please watch the YouTube video of this blog for better understanding.<br />
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<!-- 800*100 --><br />
<ins class="adsbygoogle" style="display: inline-block; width: 800px; height: 100px;" data-ad-client="ca-pub-9173866185064071" data-ad-slot="9211570346"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></p>
<div id="themify_builder_content-257" data-postid="257" class="themify_builder_content themify_builder_content-257 themify_builder themify_builder_front">

	</div>
<!-- /themify_builder_content --><p>The post <a rel="nofollow" href="https://automationtesting.in/capture-screenshot-in-extent-reports-java/">Capture Screenshot in Extent Reports &#8211; Java</a> appeared first on <a rel="nofollow" href="https://automationtesting.in">Selenium Webdriver Appium Complete Tutorial</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://automationtesting.in/capture-screenshot-in-extent-reports-java/feed/</wfw:commentRss>
			<slash:comments>11</slash:comments>
		
		
			</item>
		<item>
		<title>Extent Reports Log Generation &#8211; Java</title>
		<link>https://automationtesting.in/extent-reports-log-generation-java/</link>
					<comments>https://automationtesting.in/extent-reports-log-generation-java/#comments</comments>
		
		<dc:creator><![CDATA[Krishna Sakinala]]></dc:creator>
		<pubDate>Thu, 08 Dec 2016 03:53:27 +0000</pubDate>
				<category><![CDATA[Extents Reports - Java]]></category>
		<category><![CDATA[advanced reports]]></category>
		<category><![CDATA[advanced selenium reports]]></category>
		<category><![CDATA[create extent reports]]></category>
		<category><![CDATA[extent reports]]></category>
		<category><![CDATA[generating extent report logs]]></category>
		<category><![CDATA[generating logs in selenium]]></category>
		<category><![CDATA[how to create extent report logs]]></category>
		<category><![CDATA[how to generate extent report log]]></category>
		<category><![CDATA[how to generate html logs]]></category>
		<category><![CDATA[HTML Reports]]></category>
		<category><![CDATA[log generation]]></category>
		<category><![CDATA[log generation in selenium]]></category>
		<category><![CDATA[pie chart]]></category>
		<category><![CDATA[Reports]]></category>
		<category><![CDATA[rich html reports]]></category>
		<category><![CDATA[Selenium]]></category>
		<category><![CDATA[selenium reports]]></category>
		<category><![CDATA[Selenium Webdriver]]></category>
		<guid isPermaLink="false">http://automationtesting.in/?p=232</guid>

					<description><![CDATA[<p>Extent Reports Log Generation will discuss about how to generate log steps in the Extent Reports. While running the test suite user want to log some information about the execution in the report. This information will help the user to understand the test step execution flow and any failures during the test suite execution. By [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://automationtesting.in/extent-reports-log-generation-java/">Extent Reports Log Generation &#8211; Java</a> appeared first on <a rel="nofollow" href="https://automationtesting.in">Selenium Webdriver Appium Complete Tutorial</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img src='http://automationtesting.in/wp-content/uploads/2016/12/LOG-GENERATION-IN-EXTENT-REPORTS-JAVA.png'></p><p><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<!-- 800*100 --><br />
<ins class="adsbygoogle" style="display: inline-block; width: 800px; height: 100px;" data-ad-client="ca-pub-9173866185064071" data-ad-slot="9211570346"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
Extent Reports Log Generation will discuss about how to generate log steps in the Extent Reports. While running the test suite user want to log some information about the execution in the report. This information will help the user to understand the test step execution flow and any failures during the test suite execution.</p>
<div class="post-video"><iframe loading="lazy" width="1165" height="655" src="https://www.youtube.com/embed/nh5ZWzM3nsk?index=3&#038;list=PL7BYd102yEfVlfHkxseYEMGpt-IpDwk65&#038;t=1s&#038;wmode=transparent&#038;fs=1"  allowfullscreen></iframe></div>
<p>By using Extent Reports we can generate logs in the HTML report. For this we need use the log() method of the ExtentTest Class. By using this method not only log the step information, we can provide the PASS, FAIL and SKIP information of the particular test case. To log the information we need to use the <strong>LogStatus.INFO</strong> as first parameter in the log() method. And we need to use <strong>LogStatus.PASS</strong> for the passed test case and <strong>LogStatus.FAIL</strong> for the failed test cases.</p>
<p><strong>Below is the sample program for generating step logs in the report:</strong></p>
<pre class="brush: java; highlight: [10,11,16,22,23,24,25,31,32,33,34,35,36]; title: ; notranslate">
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import com.relevantcodes.extentreports.ExtentReports;
import com.relevantcodes.extentreports.ExtentTest;
import com.relevantcodes.extentreports.LogStatus;

public class CreatingStepLogs
{
    ExtentReports extent;
    ExtentTest test;
    
    @BeforeTest
    public void config()
    {
        extent = new ExtentReports(System.getProperty(&quot;user.dir&quot;) +&quot;/test-output/ExtentStepLogs.html&quot;, true);
    }
    
    @Test
    public void stepLogsGeneration()
    {
        test = extent.startTest(&quot;stepLogsGeneration&quot;);
        test.log(LogStatus.INFO, &quot;startTest() method will return the Extent Test object &quot;);
        test.log(LogStatus.INFO, &quot;I am in actual test method&quot;);
        test.log(LogStatus.INFO, &quot;We Can Write The Actual Test Logic In This Test&quot;);
    }
        
    @AfterTest
    public void tearDown()
    {
        extent.endTest(test);
        test.log(LogStatus.INFO, &quot;endTest() method will stop capturing information about the test log&quot;);
        extent.flush();
        test.log(LogStatus.INFO, &quot;flush() method of ExtentReports wil push/write everything to the document&quot;);
        test.log(LogStatus.INFO, &quot;close() method will clear/close all resource of the ExtentReports object&quot;);
        extent.close();
    }
}
</pre>
<p>In the above program we have written so many test.log methods to log the information into the extent reports. This information will logged in the report with time stamp.</p>
<p><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<!-- 800*100 --><br />
<ins class="adsbygoogle" style="display: inline-block; width: 800px; height: 100px;" data-ad-client="ca-pub-9173866185064071" data-ad-slot="9211570346"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<strong>Below is the output/report of the above program.</strong></p>
<p><a href="https://automationtesting.in/wp-content/uploads/2016/12/Extent-Reports-Log-Generation.png"><img decoding="async" loading="lazy" class="alignnone size-full wp-image-233" src="https://automationtesting.in/wp-content/uploads/2016/12/Extent-Reports-Log-Generation.png" alt="Extent Reports Log Generation" width="1916" height="506" srcset="https://automationtesting.in/wp-content/uploads/2016/12/Extent-Reports-Log-Generation.png 1916w, https://automationtesting.in/wp-content/uploads/2016/12/Extent-Reports-Log-Generation-300x79.png 300w, https://automationtesting.in/wp-content/uploads/2016/12/Extent-Reports-Log-Generation-768x203.png 768w, https://automationtesting.in/wp-content/uploads/2016/12/Extent-Reports-Log-Generation-1024x270.png 1024w" sizes="(max-width: 1916px) 100vw, 1916px" /></a></p>
<p>Please watch the YouTube video of this blog for better understanding.<br />
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<!-- 800*100 --><br />
<ins class="adsbygoogle" style="display: inline-block; width: 800px; height: 100px;" data-ad-client="ca-pub-9173866185064071" data-ad-slot="9211570346"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></p>
<div id="themify_builder_content-232" data-postid="232" class="themify_builder_content themify_builder_content-232 themify_builder themify_builder_front">

	</div>
<!-- /themify_builder_content --><p>The post <a rel="nofollow" href="https://automationtesting.in/extent-reports-log-generation-java/">Extent Reports Log Generation &#8211; Java</a> appeared first on <a rel="nofollow" href="https://automationtesting.in">Selenium Webdriver Appium Complete Tutorial</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://automationtesting.in/extent-reports-log-generation-java/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Generating Extent Reports &#8211; Java</title>
		<link>https://automationtesting.in/generating-extent-reports-java/</link>
					<comments>https://automationtesting.in/generating-extent-reports-java/#comments</comments>
		
		<dc:creator><![CDATA[Krishna Sakinala]]></dc:creator>
		<pubDate>Wed, 07 Dec 2016 03:17:29 +0000</pubDate>
				<category><![CDATA[Extents Reports - Java]]></category>
		<category><![CDATA[advanced reports]]></category>
		<category><![CDATA[advanced selenium reports]]></category>
		<category><![CDATA[create extent reports]]></category>
		<category><![CDATA[extent reports]]></category>
		<category><![CDATA[generating extent reports]]></category>
		<category><![CDATA[how to create extent reports]]></category>
		<category><![CDATA[how to generate extent reports]]></category>
		<category><![CDATA[HTML Reports]]></category>
		<category><![CDATA[pie chart]]></category>
		<category><![CDATA[Reports]]></category>
		<category><![CDATA[rich html reports]]></category>
		<category><![CDATA[Selenium]]></category>
		<category><![CDATA[selenium reports]]></category>
		<category><![CDATA[Selenium Webdriver]]></category>
		<category><![CDATA[Webdriver]]></category>
		<guid isPermaLink="false">http://automationtesting.in/?p=161</guid>

					<description><![CDATA[<p>Extent reports are very rich HTML reports for the selenium webdriver. This report will give so much of information about the execution status. The extra information can be provided from the external XML file. Once you create the XML file need to load in the program to read the configuration. We can provide below information [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://automationtesting.in/generating-extent-reports-java/">Generating Extent Reports &#8211; Java</a> appeared first on <a rel="nofollow" href="https://automationtesting.in">Selenium Webdriver Appium Complete Tutorial</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img src='http://automationtesting.in/wp-content/uploads/2016/12/GENERATING-EXTENT-REPORTS-JAVA.png'></p><p><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<!-- Responsive --><br />
<ins class="adsbygoogle" style="display: block;" data-ad-client="ca-pub-9173866185064071" data-ad-slot="6638633547" data-ad-format="auto"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<span style="font-weight: 400;">Extent reports are very rich HTML reports for the selenium webdriver. This report will give so much of information about the execution status. The extra information can be provided from the external XML file. Once you create the XML file need to load in the program to read the configuration.</span></p>
<div class="post-video"><iframe loading="lazy" width="1165" height="655" src="https://www.youtube.com/embed/iIp7_n01RzI?index=2&#038;list=PL7BYd102yEfVlfHkxseYEMGpt-IpDwk65&#038;t=21s&#038;wmode=transparent&#038;fs=1"  allowfullscreen></iframe></div>
<p><span style="font-weight: 400;">We can provide below information to the report using XML file:</span></p>
<ol>
<li style="font-weight: 400;"><span style="font-weight: 400;">Report Title</span></li>
<li style="font-weight: 400;"><span style="font-weight: 400;">Report Name</span></li>
<li style="font-weight: 400;"><span style="font-weight: 400;">Report Headline</span></li>
<li style="font-weight: 400;"><span style="font-weight: 400;">Date Format</span></li>
<li style="font-weight: 400;"><span style="font-weight: 400;">Time Format</span></li>
</ol>
<p><span style="font-weight: 400;">Apart from the above we can provide </span><b>HostName</b><span style="font-weight: 400;">, </span><b>Environment Information</b><span style="font-weight: 400;"> and </span><b>User Name</b><span style="font-weight: 400;"> etc… from the program.</span></p>
<p><b>Below is the sample program:</b></p>
<pre class="brush: java; highlight: [14,15,20,21,22,23,24,25,31,33,39,41,49,52,58,59]; title: ; notranslate">
import java.io.File;
import org.testng.Assert;
import org.testng.ITestResult;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import com.relevantcodes.extentreports.ExtentReports;
import com.relevantcodes.extentreports.ExtentTest;
import com.relevantcodes.extentreports.LogStatus;

public class GenerateExtentReport
{
    ExtentReports extent;
    ExtentTest test;
        
    @BeforeTest
    public void startReport()
    {
        extent = new ExtentReports(System.getProperty(&quot;user.dir&quot;) +&quot;/test-output/MyOwnReport.html&quot;, true);
        extent
        .addSystemInfo(&quot;Host Name&quot;, &quot;Krishna&quot;)
        .addSystemInfo(&quot;Environment&quot;, &quot;QA&quot;)
        .addSystemInfo(&quot;User Name&quot;, &quot;Krishna Sakinala&quot;);
        extent.loadConfig(new File(System.getProperty(&quot;user.dir&quot;)+&quot;\\extent-config.xml&quot;));
    }
    
    @Test
    public void demoReportPass()
    {
        test=extent.startTest(&quot;demoReportPass&quot;);
        Assert.assertTrue(true);
        test.log(LogStatus.PASS, &quot;Assert Pass as condition is True&quot;);
    }
    
    @Test
    public void demoReportFail()
    {
        test=extent.startTest(&quot;demoReportFail&quot;);
        Assert.assertTrue(false);
        test.log(LogStatus.FAIL, &quot;Assert Fail as condition is False&quot;);
    }
    
    @AfterMethod
    public void getResult(ITestResult result)
    {
        if(result.getStatus()==ITestResult.FAILURE)
        {
            test.log(LogStatus.FAIL, result.getThrowable());
            
        }
        extent.endTest(test);
    }
    
    @AfterTest
    public void endreport()
    {
        extent.flush();
        extent.close();
    }
}
</pre>
<p><span style="font-weight: 400;">In the above program, we have used two classes called </span><b>ExtentReports</b><span style="font-weight: 400;">, </span><b>ExtentTest</b><span style="font-weight: 400;">. These two classes objects will help us to create a rich HTML reports with lot of useful information. ExtentReports  will take the HTML report file path as an argument and it will create the report file with the mentioned name in the mentioned location. And ExtentTest</span> <span style="font-weight: 400;">will be used to log the so much information to the report like PASS, FAIL  and SKIP status of the executed tests. </span></p>
<p><b>Important points to be remember:</b></p>
<ol>
<li style="font-weight: 400;"><span style="font-weight: 400;">ExtentReports will create the report file.</span></li>
<li style="font-weight: 400;"><span style="font-weight: 400;">ExtentTest will log the information in the report.</span></li>
<li style="font-weight: 400;"><b>startTest()</b><span style="font-weight: 400;"> method of ExtentReports class is the starting point of the test and it will return the ExtentTest object.</span></li>
<li style="font-weight: 400;"><span style="font-weight: 400;">We need to capture that object into ExtentTest object.</span></li>
<li style="font-weight: 400;"><span style="font-weight: 400;">Used this reference to log the information into the report.</span></li>
<li style="font-weight: 400;"><span style="font-weight: 400;">ExtentReports object will be used to add the report information like Title, Header and Theme etc..</span></li>
<li style="font-weight: 400;"><span style="font-weight: 400;">And the above configuration need to passed from the external XML file using </span><b>loadConfig()</b><span style="font-weight: 400;"> method of ExtentReports class. It will take the XML file path as argument.</span></li>
<li style="font-weight: 400;"><b>endTest()</b><span style="font-weight: 400;"> method of ExtentReports will stop capturing information about the test log.</span></li>
<li style="font-weight: 400;"><b>flush()</b><span style="font-weight: 400;"> method of ExtentReports wil push/write everything to the document.</span></li>
<li style="font-weight: 400;"><b>close()</b><span style="font-weight: 400;"> method of ExtentReports will clear/close all resource of the ExtentReports object.</span></li>
</ol>
<p><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<!-- 800*100 --><br />
<ins class="adsbygoogle" style="display: inline-block; width: 800px; height: 100px;" data-ad-client="ca-pub-9173866185064071" data-ad-slot="9211570346"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br />
<b>Below is the sample configuration file:</b></p>
<pre class="brush: xml; highlight: [17,20,23]; title: ; notranslate">
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?--&gt;

  
    &lt;!-- report theme --&gt;
    &lt;!-- standard, dark --&gt;
    standard
  
    &lt;!-- document encoding --&gt;
    &lt;!-- defaults to UTF-8 --&gt;
    UTF-8
    
    &lt;!-- protocol for script and stylesheets --&gt;
    &lt;!-- defaults to https --&gt;
    https
    
    &lt;!-- title of the document --&gt;
    ExtentReports 2.0
    
    &lt;!-- report name - displayed at top-nav --&gt;
    Automation Report
    
    &lt;!-- report headline - displayed at top-nav, after reportHeadline --&gt;
    
    
    &lt;!-- global date format override --&gt;
    &lt;!-- defaults to yyyy-MM-dd --&gt;
    yyyy-MM-dd
    
    &lt;!-- global time format override --&gt;
    &lt;!-- defaults to HH:mm:ss --&gt;
    HH:mm:ss
    
    &lt;!-- custom javascript --&gt;
    &lt;scripts&gt;
      &lt;!&#x5B;CDATA&#x5B; $(document).ready(function() { }); ]]&gt;
    &lt;/scripts&gt;
    
    &lt;!-- custom styles --&gt;
    &lt;styles&gt;
      &lt;!&#x5B;CDATA&#x5B; ]]&gt;
    &lt;/styles&gt;
  &lt;/configuration&gt;
&lt;/extentreports&gt;
</pre>
<p><span style="font-weight: 400;">This ways we can configure the report information and can generate the extent reports.</span></p>
<p><b>Output of the above program is:</b></p>
<p><a href="https://automationtesting.in/wp-content/uploads/2016/12/ExtentReport1.png"><img decoding="async" loading="lazy" class="alignnone size-full wp-image-173" src="https://automationtesting.in/wp-content/uploads/2016/12/ExtentReport1.png" alt="ExtentReport 1" width="1363" height="655" srcset="https://automationtesting.in/wp-content/uploads/2016/12/ExtentReport1.png 1363w, https://automationtesting.in/wp-content/uploads/2016/12/ExtentReport1-300x144.png 300w, https://automationtesting.in/wp-content/uploads/2016/12/ExtentReport1-768x369.png 768w, https://automationtesting.in/wp-content/uploads/2016/12/ExtentReport1-1024x492.png 1024w" sizes="(max-width: 1363px) 100vw, 1363px" /></a> <a href="https://automationtesting.in/wp-content/uploads/2016/12/ExtentReport2.png"><img decoding="async" loading="lazy" class="alignnone size-full wp-image-174" src="https://automationtesting.in/wp-content/uploads/2016/12/ExtentReport2.png" alt="ExtentReport 2" width="1352" height="647" srcset="https://automationtesting.in/wp-content/uploads/2016/12/ExtentReport2.png 1352w, https://automationtesting.in/wp-content/uploads/2016/12/ExtentReport2-300x144.png 300w, https://automationtesting.in/wp-content/uploads/2016/12/ExtentReport2-768x368.png 768w, https://automationtesting.in/wp-content/uploads/2016/12/ExtentReport2-1024x490.png 1024w" sizes="(max-width: 1352px) 100vw, 1352px" /></a></p>
<p><span style="font-weight: 400;">Please watch the YouTube video of this blog for better understanding.</span><br />
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
<!-- Responsive --><br />
<ins class="adsbygoogle" style="display: block;" data-ad-client="ca-pub-9173866185064071" data-ad-slot="6638633547" data-ad-format="auto"></ins><br />
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></p>
<div id="themify_builder_content-161" data-postid="161" class="themify_builder_content themify_builder_content-161 themify_builder themify_builder_front">

	</div>
<!-- /themify_builder_content --><p>The post <a rel="nofollow" href="https://automationtesting.in/generating-extent-reports-java/">Generating Extent Reports &#8211; Java</a> appeared first on <a rel="nofollow" href="https://automationtesting.in">Selenium Webdriver Appium Complete Tutorial</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://automationtesting.in/generating-extent-reports-java/feed/</wfw:commentRss>
			<slash:comments>11</slash:comments>
		
		
			</item>
		<item>
		<title>Extent Reports Introduction &#8211; Java</title>
		<link>https://automationtesting.in/extent-reports-introduction-java/</link>
					<comments>https://automationtesting.in/extent-reports-introduction-java/#respond</comments>
		
		<dc:creator><![CDATA[Krishna Sakinala]]></dc:creator>
		<pubDate>Wed, 07 Dec 2016 02:27:59 +0000</pubDate>
				<category><![CDATA[Extents Reports - Java]]></category>
		<category><![CDATA[advanced reports]]></category>
		<category><![CDATA[advanced selenium reports]]></category>
		<category><![CDATA[extent reports]]></category>
		<category><![CDATA[extent reports introduction]]></category>
		<category><![CDATA[HTML Reports]]></category>
		<category><![CDATA[pie chart]]></category>
		<category><![CDATA[Reports]]></category>
		<category><![CDATA[rich html reports]]></category>
		<category><![CDATA[Selenium]]></category>
		<category><![CDATA[selenium reports]]></category>
		<category><![CDATA[Selenium Webdriver]]></category>
		<category><![CDATA[Webdriver]]></category>
		<guid isPermaLink="false">http://automationtesting.in/?p=135</guid>

					<description><![CDATA[<p>In software test automation after completion of the test suite execution we need to have a report for the execution status and it is the only way of evidence for the pass and fail status of the tests. And most of the clients bother about the detailed report of the execution status. Most of the [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://automationtesting.in/extent-reports-introduction-java/">Extent Reports Introduction &#8211; Java</a> appeared first on <a rel="nofollow" href="https://automationtesting.in">Selenium Webdriver Appium Complete Tutorial</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><img src='http://automationtesting.in/wp-content/uploads/2016/12/EXTENT-REPORTS-INTRODUCTION-JAVA.png'></p><p>In software test automation after completion of the test suite execution we need to have a report for the execution status and it is the only way of evidence for the pass and fail status of the tests. And most of the clients bother about the detailed report of the execution status. Most of the licensed automation testing tools will have in built rich report option to show the execution status. But coming to open source automation tools lacking in this option. Same way, Selenium also does not have the automation report generation option. But to execute the test suite, selenium is depending on unit testing frameworks like TestNG and Junit.</p>
<div class="post-video"><iframe loading="lazy" width="1165" height="655" src="https://www.youtube.com/embed/AJMG1kroGGE?wmode=transparent&#038;fs=1list=PL7BYd102yEfVlfHkxseYEMGpt-IpDwk65"  allowfullscreen></iframe></div>
<p>After test suite execution using TestNG or Junit, by default they will give the HTML reports, but the information provided by these reports are not so good. To avoid this, we are using XSLT reports, these are much better than normal TestNG and Junit reports.These will give a pie chart to represent the PASS,FAIL and SKIP test cases. Apart from this PIE Chart it will not give anymore information in the generated HTML report. If we want any other information we need to write separate code.</p>
<p><strong>TestNG Default Report:</strong></p>
<p><a href="https://automationtesting.in/wp-content/uploads/2016/12/defaultTestNG.png"><img decoding="async" loading="lazy" class="alignnone size-full wp-image-153" src="https://automationtesting.in/wp-content/uploads/2016/12/defaultTestNG.png" alt="Default TestNG Report" width="1910" height="570" srcset="https://automationtesting.in/wp-content/uploads/2016/12/defaultTestNG.png 1910w, https://automationtesting.in/wp-content/uploads/2016/12/defaultTestNG-300x90.png 300w, https://automationtesting.in/wp-content/uploads/2016/12/defaultTestNG-768x229.png 768w, https://automationtesting.in/wp-content/uploads/2016/12/defaultTestNG-1024x306.png 1024w" sizes="(max-width: 1910px) 100vw, 1910px" /></a></p>
<p><strong>XSLT Report:</strong></p>
<p><a href="https://automationtesting.in/wp-content/uploads/2016/12/xslt.png"><img decoding="async" loading="lazy" class="alignnone size-full wp-image-155" src="https://automationtesting.in/wp-content/uploads/2016/12/xslt.png" alt="XSLT Report" width="1907" height="398" srcset="https://automationtesting.in/wp-content/uploads/2016/12/xslt.png 1907w, https://automationtesting.in/wp-content/uploads/2016/12/xslt-300x63.png 300w, https://automationtesting.in/wp-content/uploads/2016/12/xslt-768x160.png 768w, https://automationtesting.in/wp-content/uploads/2016/12/xslt-1024x214.png 1024w" sizes="(max-width: 1907px) 100vw, 1907px" /></a></p>
<p>To overcome these type of issues, we can use Extent Reports. These are very good and rich HTML reports. By using these reports we can provide lot information to the reports. These will also give the status in the form of PIE Chart.</p>
<p><strong>Below are the advantages provided by the Extent Reports:</strong></p>
<ol>
<li>Status will be shown in the form of PIE chart.</li>
<li>Can replace the existing report with the new report or append the new status to the existing report.</li>
<li>We can change display order of the tests(i.e. oldest test at the top, newest at the end or newest test at the top, oldest at the end)</li>
<li>Can generate ONLINE or OFFLINE reports.</li>
<li>Can give the our own name to the test method (i.e can change the test method name in the report).</li>
<li>Can generate stepwise log information in the report.</li>
<li>Can segregate the tests using Test Categories.</li>
<li>Can give test author name to display in the report.</li>
<li>Can add a test node as a child of another test.</li>
<li>Can insert any custom HTML in the logs by using an HTML tag.</li>
<li>Can show the screenshots in the report wherever we need.</li>
<li>Can add recording of your test runs in the report.</li>
<li>Can add our own information in the report (i.e. version of selenium used, Environment information where the test suite executed).</li>
<li>Can give our own name to the HTML report.</li>
<li>It will give the System information in the report (i.e. HostName and OS used to execute the test suite.)</li>
</ol>
<p>The above are the advantages provided by the extent reports. We can discuss all these things in the coming blogs.</p>
<p><strong>Extent Report:</strong></p>
<p><a href="https://automationtesting.in/wp-content/uploads/2016/12/ExtentReport.gif"><img decoding="async" loading="lazy" class="alignnone size-full wp-image-154" src="https://automationtesting.in/wp-content/uploads/2016/12/ExtentReport.gif" alt="Extent Report" width="1912" height="958" /></a></p>
<p><span style="font-weight: 400;">You can find the complete information in the below link:</span></p>
<p><a href="http://extentreports.relevantcodes.com/java/"><span style="font-weight: 400;">http://extentreports.relevantcodes.com/java/</span></a></p>
<p><span style="font-weight: 400;">You can download the Extent Reports Jars in this link:</span></p>
<p><a href="http://extentreports.relevantcodes.com/"><span style="font-weight: 400;">http://extentreports.relevantcodes.com/</span></a></p>
<p>Last but not least, a big thanks to Anshoo Arora for giving this type of reports.</p>
<p>Please watch the YouTube video of this blog for better understanding.</p>
<div id="themify_builder_content-135" data-postid="135" class="themify_builder_content themify_builder_content-135 themify_builder themify_builder_front">

	</div>
<!-- /themify_builder_content --><p>The post <a rel="nofollow" href="https://automationtesting.in/extent-reports-introduction-java/">Extent Reports Introduction &#8211; Java</a> appeared first on <a rel="nofollow" href="https://automationtesting.in">Selenium Webdriver Appium Complete Tutorial</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://automationtesting.in/extent-reports-introduction-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
