Error:
Test method Reports.CodedUITest2.SampleExtentReports threw exception:
System.NullReferenceException: Object reference not set to an instance of an object.
Problem in the statement:
extenttest = extentreport.CreateTest("HariExtentReports");
Issue in the CreateTest method.
Here is the code snippet:
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Windows.Input;
using System.Windows.Forms;
using System.Drawing;
using Microsoft.VisualStudio.TestTools.UITesting;
using Microsoft.VisualStudio.TestTools.UITesting.HtmlControls;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UITest.Extension;
using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard;
using AventStack.ExtentReports;
using System.Configuration;
namespace Reports
{
///
/// Summary description for CodedUITest2
///
[CodedUITest]
public class CodedUITest2
{
public CodedUITest2()
{
}
public static ExtentReports extentreport;
public static ExtentTest extenttest;
Error: Test method Reports.CodedUITest2.SampleExtentReports threw exception: System.NullReferenceException: Object reference not set to an instance of an object.
Problem in the statement: extenttest = extentreport.CreateTest("HariExtentReports");
Issue in the CreateTest method.
Here is the code snippet: using System; using System.Collections.Generic; using System.Text.RegularExpressions; using System.Windows.Input; using System.Windows.Forms; using System.Drawing; using Microsoft.VisualStudio.TestTools.UITesting; using Microsoft.VisualStudio.TestTools.UITesting.HtmlControls; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UITest.Extension; using Keyboard = Microsoft.VisualStudio.TestTools.UITesting.Keyboard; using AventStack.ExtentReports;
using System.Configuration;
namespace Reports { ///
/// Summary description for CodedUITest2
///
[CodedUITest]
public class CodedUITest2
{
public CodedUITest2()
{
}
public static ExtentReports extentreport;
public static ExtentTest extenttest;