
ExtentTest : By using this class we could generate the logs in the report.ExtentReports : By using this class we set the path where our reports need to generate.Imported two classes ExtentReports and ExtentTest.

String finalpth = pth.Substring(0, pth.LastIndexOf(“bin”)) + “\\Defect_Screenshots\\” + screenShotName + “.png” String pth = ().CodeBase ĭirectoryInfo di = Directory.CreateDirectory(dir + “\\Defect_Screenshots\\”) Screenshot screenshot = ts.GetScreenshot() ITakesScreenshot ts = (ITakesScreenshot)driver Private string Capture(IWebDriver driver, string screenShotName) / To capture the screenshot for extent report and return actual file path _test.Log(logstatus, “Test ended with ” + logstatus) _test.Log(logstatus, “Snapshot below: ” + _test.AddScreenCaptureFromPath(screenShotPath)) _test.Log(logstatus, “Test ended with ” + logstatus + ” – ” + errorMessage) String screenShotPath = Capture(driver, ) / Finish the execution and logging the detials into HTML report _test = _extent.CreateTest() Īssert.AreEqual(driver.Title, “Journey”) /Getting the name of current running test to extent report _extent.AddSystemInfo(“User Name”, “Sanoj”) _extent.AddSystemInfo(“Environment”, “Journey of Quality”) Var htmlReporter = new ExtentHtmlReporter(dir + “\\Test_Execution_Reports” + “\\Automation_Report” + “.html”) Var dir = (“\\bin\\Debug”, “”) ĭirectoryInfo di = Directory.CreateDirectory(dir + “\\Test_Execution_Reports”) To create report directory and add HTML report into it /For report directory creation and HTML report template creation
#Nunit visual studio for mac code


NUnit and NUnit3TestAdapter should be installed via package manager.Visual Studio 2017 should be installed.Prerequisites to Generate Extent Reports: Here, I would like to share the details on the integration and implementation of Extent Report utility in Automation test classes that built with NUnit. One day, I thought to build a custom beautiful high rich HTML reports with minimum effort that time I used AventStack’s Extent Report. I observed that the difficulty to generate rich HTML report in Automation using NUnit.
