<?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 - C# Archives | Selenium Webdriver Appium Complete Tutorial</title>
	<atom:link href="https://automationtesting.in/category/extents-reports-c/feed/" rel="self" type="application/rss+xml" />
	<link>https://automationtesting.in/category/extents-reports-c/</link>
	<description>Automation Testing</description>
	<lastBuildDate>Wed, 22 Mar 2017 02:38:17 +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; CSharp</title>
		<link>https://automationtesting.in/capture-screenshot-in-extent-reports-csharp/</link>
					<comments>https://automationtesting.in/capture-screenshot-in-extent-reports-csharp/#comments</comments>
		
		<dc:creator><![CDATA[Krishna Sakinala]]></dc:creator>
		<pubDate>Fri, 09 Dec 2016 01:27:48 +0000</pubDate>
				<category><![CDATA[Extents Reports - C#]]></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=287</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-csharp/">Capture Screenshot in Extent Reports &#8211; CSharp</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/CAPTURE-SCREENSHOTS-IN-EXTENT-REPORTS-CSharp.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>
<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: csharp; highlight: [17,18,28,34,39,51,52,53,55,62,63]; title: ; notranslate">
using NUnit.Framework;
using NUnit.Framework.Interfaces;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using RelevantCodes.ExtentReports;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ExtentReportsDemo
{
    &#x5B;TestFixture]
    public class CapturingScreenshot
    {
        ExtentReports extent;
        ExtentTest test;
        IWebDriver driver;

        &#x5B;OneTimeSetUp]
        public void Init()
        {
            string path = System.Reflection.Assembly.GetCallingAssembly().CodeBase;
            string actualPath = path.Substring(0, path.LastIndexOf(&quot;bin&quot;));
            string projectPath = new Uri(actualPath).LocalPath;
            string reportPath = projectPath + &quot;Reports\\ExtentScreenshot.html&quot;;
            extent = new ExtentReports(reportPath, true);
        }

        &#x5B;Test]
        public void CaptureScreenshot()
        {
            test = extent.StartTest(&quot;CaptureScreenshot&quot;);
            driver = new FirefoxDriver();
            driver.Navigate().GoToUrl(&quot;https://automationtesting.in&quot;);
            string title = driver.Title;
            Assert.AreEqual(&quot;Home - Automation Test&quot;, title);
            test.Log(LogStatus.Pass, &quot;Test Passed&quot;);
        }

        &#x5B;TearDown]
        public void GetResult()
        {
            var status = TestContext.CurrentContext.Result.Outcome.Status;
            var stackTrace = &quot;&lt;pre&gt;&quot; + TestContext.CurrentContext.Result.StackTrace + &quot;&lt;/pre&gt;&quot;;
            var errorMessage = TestContext.CurrentContext.Result.Message;

            if (status == TestStatus.Failed)
            {
                string screenShotPath = GetScreenShot.Capture(driver, &quot;ScreenShotName&quot;);
                test.Log(LogStatus.Fail, stackTrace + errorMessage);
                test.Log(LogStatus.Fail, &quot;Snapshot below: &quot; + test.AddScreenCapture(screenShotPath));
            }
            extent.EndTest(test);
        }

        &#x5B;OneTimeTearDown]
        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: csharp; highlight: [16,17,18,19,20,21,22]; title: ; notranslate">
using OpenQA.Selenium;
using System;
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ExtentReportsDemo
{
    public class GetScreenShot
    {
        public static string Capture(IWebDriver driver, string screenShotName)
        {
            ITakesScreenshot ts = (ITakesScreenshot)driver;
            Screenshot screenshot = ts.GetScreenshot();
            string pth = System.Reflection.Assembly.GetCallingAssembly().CodeBase;
            string finalpth = pth.Substring(0, pth.LastIndexOf(&quot;bin&quot;)) + &quot;ErrorScreenshots\\&quot; + screenShotName + &quot;.png&quot;;
            string localpath = new Uri(finalpth).LocalPath;
            screenshot.SaveAsFile(localpath, ImageFormat.Png);
            return localpath;
        }
    }
}
</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-287" data-postid="287" class="themify_builder_content themify_builder_content-287 themify_builder themify_builder_front">

	</div>
<!-- /themify_builder_content --><p>The post <a rel="nofollow" href="https://automationtesting.in/capture-screenshot-in-extent-reports-csharp/">Capture Screenshot in Extent Reports &#8211; CSharp</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-csharp/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Extent Reports Log Generation &#8211; CSharp</title>
		<link>https://automationtesting.in/extent-reports-log-generation-csharp/</link>
					<comments>https://automationtesting.in/extent-reports-log-generation-csharp/#respond</comments>
		
		<dc:creator><![CDATA[Krishna Sakinala]]></dc:creator>
		<pubDate>Fri, 09 Dec 2016 01:20:31 +0000</pubDate>
				<category><![CDATA[Extents Reports - C#]]></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>
		<category><![CDATA[Webdriver]]></category>
		<guid isPermaLink="false">http://automationtesting.in/?p=280</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-csharp/">Extent Reports Log Generation &#8211; CSharp</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-CSharp.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>
<p>By using Extent Reports we can generate logs in the HTML report. For this we need use the <strong>Log()</strong> 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: csharp; highlight: [14,15,24,30,31,32,33,39,40,41,42,43,44]; title: ; notranslate">
using NUnit.Framework;
using RelevantCodes.ExtentReports;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ExtentReportsDemo
{
    &#x5B;TestFixture]
    public class CreatingStepLogs
    {
        public ExtentReports extent;
        public ExtentTest test;

        &#x5B;OneTimeSetUp]
        public void StartReport()
        {
            string path = System.Reflection.Assembly.GetCallingAssembly().CodeBase;
            string actualPath = path.Substring(0, path.LastIndexOf(&quot;bin&quot;));
            string projectPath = new Uri(actualPath).LocalPath;
            string reportPath = projectPath + &quot;Reports\\ExtentStepLogs.html&quot;;
            extent = new ExtentReports(reportPath, true);
        }

        &#x5B;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;);
        }

        &#x5B;OneTimeTearDown]
        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 <strong>test.Log</strong> methods to log the information 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 />
<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><br />
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-280" data-postid="280" class="themify_builder_content themify_builder_content-280 themify_builder themify_builder_front">

	</div>
<!-- /themify_builder_content --><p>The post <a rel="nofollow" href="https://automationtesting.in/extent-reports-log-generation-csharp/">Extent Reports Log Generation &#8211; CSharp</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-csharp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Generating Extent Reports &#8211; CSharp</title>
		<link>https://automationtesting.in/generating-extent-reports-csharp/</link>
					<comments>https://automationtesting.in/generating-extent-reports-csharp/#comments</comments>
		
		<dc:creator><![CDATA[Krishna Sakinala]]></dc:creator>
		<pubDate>Fri, 09 Dec 2016 01:10:12 +0000</pubDate>
				<category><![CDATA[Extents Reports - C#]]></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>
		<category><![CDATA[Webdriver]]></category>
		<guid isPermaLink="false">http://automationtesting.in/?p=271</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-csharp/">Generating Extent Reports &#8211; CSharp</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-CSharp.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 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.</p>
<p><strong>We can provide below information to the report using XML file:</strong></p>
<ol>
<li>Report Title</li>
<li>Report Name</li>
<li>Report Headline</li>
<li>Date Format</li>
<li>Time Format</li>
</ol>
<p>Apart from the above we can provide HostName, Environment Information and User Name etc… from the program.</p>
<p><strong>Below is the sample program:</strong></p>
<pre class="brush: csharp; highlight: [16,17,27,28,29,30,31,32,38,40,46,48,60,62,68,69]; title: ; notranslate">
using NUnit.Framework;
using NUnit.Framework.Interfaces;
using RelevantCodes.ExtentReports;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ExtentReportsDemo
{
    &#x5B;TestFixture]
    public class BasicReport
    {
        public ExtentReports extent;
        public ExtentTest test;

        &#x5B;OneTimeSetUp]
        public void StartReport()
        {
            string path = System.Reflection.Assembly.GetCallingAssembly().CodeBase;
            string actualPath = path.Substring(0, path.LastIndexOf(&quot;bin&quot;));
            string projectPath = new Uri(actualPath).LocalPath;
            string reportPath = projectPath + &quot;Reports\\MyOwnReport.html&quot;;

            extent = new ExtentReports(reportPath, 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(projectPath + &quot;extent-config.xml&quot;);
        }
        
        &#x5B;Test]
        public void DemoReportPass()
        {
            test = extent.StartTest(&quot;DemoReportPass&quot;);
            Assert.IsTrue(true);
            test.Log(LogStatus.Pass, &quot;Assert Pass as condition is True&quot;);
        }

        &#x5B;Test]
        public void DemoReportFail()
        {
            test = extent.StartTest(&quot;DemoReportFail&quot;);
            Assert.IsTrue(false);
            test.Log(LogStatus.Pass, &quot;Assert Fail as condition is False&quot;);
        }

        &#x5B;TearDown]
        public void GetResult()
        {
            var status = TestContext.CurrentContext.Result.Outcome.Status;
            var stackTrace = &quot;&lt;pre&gt;&quot; + TestContext.CurrentContext.Result.StackTrace + &quot;&lt;/pre&gt;&quot;;
            var errorMessage = TestContext.CurrentContext.Result.Message;

            if (status == TestStatus.Failed)
            {
                test.Log(LogStatus.Fail, stackTrace + errorMessage);
            }
            extent.EndTest(test);
        }

        &#x5B;OneTimeTearDown]
        public void EndReport()
        {
            extent.Flush();
            extent.Close();
        }
    }
}
</pre>
<p>In the above program, we have used two classes called <strong>ExtentReports</strong>, <strong>ExtentTest</strong>. 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 will be used to log the so much information to the report like PASS, FAIL  and SKIP status of the executed tests.</p>
<p><strong>Important points to be remember:</strong></p>
<ol>
<li>ExtentReports will create the report file.</li>
<li>ExtentTest will log the information in the report.</li>
<li><strong>StartTest()</strong> method of ExtentReports class is the starting point of the test and it will return the ExtentTest object.</li>
<li>We need to capture that object into ExtentTest object.</li>
<li>Used this reference to log the information into the report.</li>
<li>ExtentReports object will be used to add the report information like Title, Header and Theme etc..</li>
<li>And the above configuration need to passed from the external XML file using <strong>LoadConfig()</strong> method of ExtentReports class. It will take the XML file path as argument.</li>
<li><strong>EndTest()</strong> method of ExtentReports will stop capturing information about the test log.</li>
<li><strong>Flush()</strong> method of ExtentReports will push/write everything to the document.</li>
<li><strong>Close()</strong> method of ExtentReports will clear/close all resource of the ExtentReports object.</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 />
<strong>Below is the sample configuration file:</strong></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;extentreports&gt;
  &lt;configuration&gt;
    &lt;!-- report theme --&gt;
    &lt;!-- standard, dark --&gt;
    &lt;theme&gt;standard&lt;/theme&gt;
 
    &lt;!-- document encoding --&gt;
    &lt;!-- defaults to UTF-8 --&gt;
    &lt;encoding&gt;UTF-8&lt;/encoding&gt;
    
    &lt;!-- protocol for script and stylesheets --&gt;
    &lt;!-- defaults to https --&gt;
    &lt;protocol&gt;https&lt;/protocol&gt;
    
    &lt;!-- title of the document --&gt;
    &lt;documentTitle&gt;AutomationTesting.in&lt;/documentTitle&gt;
    
    &lt;!-- report name - displayed at top-nav --&gt;
    &lt;reportName&gt;Automation Testing Report&lt;/reportName&gt;
    
    &lt;!-- report headline - displayed at top-nav, after reportHeadline --&gt;
    &lt;reportHeadline&gt;- QA Environment&lt;/reportHeadline&gt;
    
    &lt;!-- global date format override --&gt;
    &lt;!-- defaults to yyyy-MM-dd --&gt;
    &lt;dateFormat&gt;yyyy-MM-dd&lt;/dateFormat&gt;
    
    &lt;!-- global time format override --&gt;
    &lt;!-- defaults to HH:mm:ss --&gt;
    &lt;timeFormat&gt;HH:mm:ss&lt;/timeFormat&gt;


    &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>This ways we can configure the report information and can generate the extent reports.</p>
<p><strong>Output of the above program is:</strong></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></p>
<p><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>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-271" data-postid="271" class="themify_builder_content themify_builder_content-271 themify_builder themify_builder_front">

	</div>
<!-- /themify_builder_content --><p>The post <a rel="nofollow" href="https://automationtesting.in/generating-extent-reports-csharp/">Generating Extent Reports &#8211; CSharp</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-csharp/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>Extent Reports Introduction &#8211; CSharp</title>
		<link>https://automationtesting.in/extent-reports-introduction-csharp/</link>
					<comments>https://automationtesting.in/extent-reports-introduction-csharp/#respond</comments>
		
		<dc:creator><![CDATA[Krishna Sakinala]]></dc:creator>
		<pubDate>Fri, 09 Dec 2016 00:50:25 +0000</pubDate>
				<category><![CDATA[Extents Reports - C#]]></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=267</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-csharp/">Extent Reports Introduction &#8211; CSharp</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-CSharp.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 />
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.</p>
<div class="post-video"><iframe loading="lazy" width="1165" height="655" src="https://www.youtube.com/embed/R7uT9oDO-d4?wmode=transparent&#038;fs=1list=PL7BYd102yEfUQpCGzmPE36MotghsmMZWT"  allowfullscreen></iframe></div>
<p>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 NUnit and MSTest.</p>
<p>After test suite execution using NUnit or MSTest, by default they will NOT give any HTML reports, If you want to generate HTML reports need to depend on other third party tools like NANT. But they will not give rich reports as the information is not that eye catchy.</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.<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 />
<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>&nbsp;</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/net/"><span style="font-weight: 400;">http://extentreports.relevantcodes.com/net/</span></a></p>
<p><span style="font-weight: 400;">You can download the Extent Reports DLLs 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><span style="font-weight: 400;">Apart from the above link, you can directly download using Nuget packages from Visual Studio. </span></p>
<p><span style="font-weight: 400;">Last but not least, a big thanks to Anshoo Arora for giving this type of reports.</span></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 />
<!-- 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-267" data-postid="267" class="themify_builder_content themify_builder_content-267 themify_builder themify_builder_front">

	</div>
<!-- /themify_builder_content --><p>The post <a rel="nofollow" href="https://automationtesting.in/extent-reports-introduction-csharp/">Extent Reports Introduction &#8211; CSharp</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-csharp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
