public static void BeforeTestRun()
 {
     _extentReports      = new ExtentReports();
     _extenthtmlreporter = new ExtentHtmlReporter(@"C:\Users\pkkbl\OneDrive\Desktop\ExtentReportPath\extentReport.html");
     _extentReports.AttachReporter(_extenthtmlreporter);
 }
        private dynamic GetExtentOptions()
        {
            switch (browser)
            {
            case "chrome":
                chromehtmlReporter = new ExtentHtmlReporter(@"D:\SlkSeleniumFramework\TestProjectSample\TestProjectCL\UnitTest\UnitTestProject1\Reports\chrome\index.html");
                string             sourceFile = @"D:\SlkSeleniumFramework\TestProjectSample\TestProjectCL\UnitTest\UnitTestProject1\Reports\chrome\index.html";
                System.IO.FileInfo fi         = new System.IO.FileInfo(sourceFile);
                if (fi.Exists)
                {
                    fi.MoveTo(@"D:\SlkSeleniumFramework\TestProjectSample\TestProjectCL\UnitTest\UnitTestProject1\Reports\chrome\Extentreport-" + timeStamp + ".html");

                    Console.WriteLine(" Chrome File Renamed!!");
                }
                Console.WriteLine("The Extent Report is generated in chrome folder.");
                break;

            case "ie":
                iehtmlReporter = new ExtentHtmlReporter(@"D:\SlkSeleniumFramework\TestProjectSample\TestProjectCL\UnitTest\UnitTestProject1\Reports\ie\index.html");
                sourceFile     = @"D:\SlkSeleniumFramework\TestProjectSample\TestProjectCL\UnitTest\UnitTestProject1\Reports\ie\index.html";
                fi             = new System.IO.FileInfo(sourceFile);
                if (fi.Exists)
                {
                    Thread.Sleep(1000);
                    fi.MoveTo(@"D:\SlkSeleniumFramework\TestProjectSample\TestProjectCL\UnitTest\UnitTestProject1\Reports\ie\Extentreport1-" + timeStamp + ".html");

                    Console.WriteLine(" IE File Renamed!!");
                }
                Console.WriteLine("The Extent Report is generated in ie folder.");
                break;

            default:
                chromehtmlReporter = new ExtentHtmlReporter(@"D:\SlkSeleniumFramework\TestProjectSample\TestProjectCL\UnitTest\UnitTestProject1\Reports\chrome\index.html");
                sourceFile         = @"D:\SlkSeleniumFramework\TestProjectSample\TestProjectCL\UnitTest\UnitTestProject1\Reports\chrome\index.html";
                fi = new System.IO.FileInfo(sourceFile);
                if (fi.Exists)
                {
                    fi.MoveTo(@"D:\SlkSeleniumFramework\TestProjectSample\TestProjectCL\UnitTest\UnitTestProject1\Reports\chrome\Extentreport-" + timeStamp + ".html");

                    Console.WriteLine(" Chrome File Renamed!!");
                }
                Console.WriteLine("The Extent Report is generated in chrome folder.");
                break;
            }



            extent = new ExtentReports();


            if (browser == "chrome")
            {
                extent.AttachReporter(chromehtmlReporter);
                return(chromehtmlReporter);
            }
            else if (browser == "ie")
            {
                extent.AttachReporter(iehtmlReporter);
                return(iehtmlReporter);
            }
            else
            {
                Console.WriteLine("The reporter is not attached.");
                return(chromehtmlReporter);
            }
        }
Exemple #3
0
 internal void AttachReporter(ExtentHtmlReporter htmlReporter)
 {
     throw new NotImplementedException();
 }
        public void Initialize()
        {
            var htmlReporter = new ExtentHtmlReporter(@"C:\Users\ayush.gupta\source\repos\DotNetQAAutomationFinalAssessment\Reports\Suite 2\index.html");

            extentReport.AttachReporter(htmlReporter);
        }
Exemple #5
0
 public static void BeforeTest()
 {
     _extentHtmlReporter = new ExtentHtmlReporter(@"C:\Users\rohin.ramadass\source\repos\EcomBDDAutomation\EcomBDDAutomation\Reports\report.html");
     _extentReports      = new ExtentReports();
     _extentReports.AttachReporter(_extentHtmlReporter);
 }
Exemple #6
0
 public void Setup()
 {
     _extent = new ExtentReports();
     _html   = new ExtentHtmlReporter(
         Path.Combine(ReportPath, DateTime.Now.ToString("yyyy-MM-dd_HH.mm.ss")) + "\\");
 }
Exemple #7
0
        /// <summary>
        /// Method automatically used on the start of the test suite to initialize the report
        /// </summary>
        /// <param name="reportName"></param>
        public void InitializeReport(string reportName, string browser)
        {
            if (ExtentWrapper == null)
            {
                ExtentWrapper = new ExtentReports();
                bool reportIsKlov = false;
                try
                {
                    reportIsKlov = ConfigurationManager.AppSettings["REPORT_IS_KLOV"].Equals("1");
                    if (reportIsKlov)
                    {
                        var klovReporter = new ExtentKlovReporter();

                        // specify mongoDb connection
                        klovReporter.InitMongoDbConnection("localhost", 27017);

                        // specify project ! you must specify a project, other a "Default project will be used"
                        klovReporter.ProjectName = reportName;

                        // you must specify a reportName otherwise a default timestamp will be used
                        klovReporter.ReportName =
                            ConfigurationManager.AppSettings["REPORT_DOCUMENT_TITLE"] + " - " +
                            ConfigurationManager.AppSettings["REPORT_NAME"];

                        // URL of the KLOV server
                        klovReporter.InitKlovServerConnection("http://localhost");

                        ExtentWrapper.AttachReporter(klovReporter);
                    }
                    else
                    {
                        string reportPath = ConfigurationManager.AppSettings["REPORT_FILE_PATH"];
                        string user       = Environment.UserName;
                        reportPath = reportPath + "\\" + user + "\\" + DateTime.Now.ToString("ddMMyyyyTHHmmss");
                        System.IO.Directory.CreateDirectory(reportPath);

                        string reportFullPath = String.Format(reportPath + @"//{0}.html", reportName + DateTime.Now.ToString("ddMMyyyyTHHmmss"));

                        Html = new ExtentHtmlReporter(reportFullPath);
                        Html.Config.DocumentTitle = ConfigurationManager.AppSettings["REPORT_DOCUMENT_TITLE"];
                        Html.Config.ReportName    = ConfigurationManager.AppSettings["REPORT_NAME"];
                        // Html.Configuration().ChartLocation = ChartLocation.Top;
                        string browserENV;
                        switch (browser)
                        {
                        case "ie":
                            browserENV = "Internet Explorer";
                            break;

                        case "firefox":
                            browserENV = "Mozilla FireFox";
                            break;

                        default:
                            browserENV = "Chrome";
                            break;
                        }
                        //get environment
                        string testingEnvironment = Utilities.GetEnvironmentUrl();
                        switch (testingEnvironment)
                        {
                        case "http://pims-test.alliedsolutions.net/PimsSupport/Account/Login":
                            testingEnvironment = "QA";
                            break;

                        case "http://pims-staging.alliedsolutions.net/ProjectX/Account/Login":
                            testingEnvironment = "STAGING";
                            break;

                        case "http://pims-dev.alliedsolutions.net/ProjectX/Account/Login":
                            testingEnvironment = "DEV";
                            break;

                        default:
                            browserENV = "PRODUCTION";
                            break;
                        }
                        var test1 = Environment.GetEnvironmentVariables();
                        var test  = Environment.GetEnvironmentVariable("USERNAME");
                        //ExtentWrapper.AddSystemInfo("NUnit Version", env.Attribute("nunit-version").Value);
                        ExtentWrapper.AddSystemInfo("Environment", testingEnvironment);
                        ExtentWrapper.AddSystemInfo("OS Version", Environment.GetEnvironmentVariable("OS"));
                        //ExtentWrapper.AddSystemInfo("Platform", env.Attribute("platform").Value);
                        //ExtentWrapper.AddSystemInfo("CLR Version", env.Attribute("clr-version").Value);
                        ExtentWrapper.AddSystemInfo("Browser", browserENV);

                        ExtentWrapper.AddSystemInfo("Machine Name", Environment.GetEnvironmentVariable("COMPUTERNAME"));
                        ExtentWrapper.AddSystemInfo("User", Environment.GetEnvironmentVariable("USERNAME"));
                        // ExtentWrapper.AddSystemInfo("User Domain",  Environment.GetEnvironmentVariable("USERDOMAIN"));
                        ExtentWrapper.AttachReporter(Html);
                    }
                }
                catch (ConfigurationErrorsException)
                {
                }
            }
        }
Exemple #8
0
        public void Initialize()
        {
            var htmlReporter = new ExtentHtmlReporter(@"C:\Users\aayush.gupta\source\repos\DotNetQAFinalAssessment\Reports\TestSuite2\GoogleTest.html");

            extentReports.AttachReporter(htmlReporter);
        }
        static ReportingManager()
        {
            var htmlReporter = new ExtentHtmlReporter("TestResults.html");//TestContext.CurrentContext.TestDirectory +

            Instance.AttachReporter(htmlReporter);
        }
 private ExtentHtmlReporter getHtmlReporter()
 {
     htmlReporter = new ExtentHtmlReporter(utils.GetProjectPath() + "\\Report\\TestReport.html");
     htmlReporter.LoadConfig(utils.GetProjectPath() + "\\Resources\\extent-config.xml");
     return(htmlReporter);
 }
 private CustomeExtentRepoter()
 {
     extentHtmlReporter = new ExtentHtmlReporter(@"C:\Data\log\restsharp\");
     extentReports      = new ExtentReports();
     extentReports.AttachReporter(extentHtmlReporter);
 }
Exemple #12
0
        public static void beforeTestRun()
        {
            var htmlReporter = new ExtentHtmlReporter(@"D:\Automation\Automation_Report-" + DateTime.Now.ToString("yyyy-dd-M-HH-mm-ss") + ".html");

            htmlReporter.Configuration().Theme = AventStack.ExtentReports.Reporter.Configuration.Theme.Dark;

            extent = new ExtentReports();



            extent.AttachReporter(htmlReporter);
            ///////////////////////////////////////////////////////


            if (File.Exists("D:/Automation/list.csv"))

            {
                StreamWriter sw = File.CreateText("D:/Automation/list.csv");
                ContextPage.GetInstance().setStreamWriter(sw);
            }
            var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            var connectionStringsSection = (ConnectionStringsSection)config.GetSection("connectionStrings");

            try
            {
                if (Common.Configuration.GetInstance().GetByKey("ConnectionString_DIGITAL_CHANNEL_SEC") != null && Common.Configuration.GetInstance().GetByKey("ProviderName") != null)
                {
                    connectionStringsSection.ConnectionStrings["DIGITAL_CHANNEL_SEC"].ConnectionString = Common.Configuration.GetInstance().GetByKey("ConnectionString_DIGITAL_CHANNEL_SEC");
                    connectionStringsSection.ConnectionStrings["DIGITAL_CHANNEL_SEC"].ProviderName     = Common.Configuration.GetInstance().GetByKey("ProviderName");
                    config.Save();
                    ConfigurationManager.RefreshSection("connectionStrings");
                }
                if (Common.Configuration.GetInstance().GetByKey("ConnectionString_QAT_BPS") != null && Common.Configuration.GetInstance().GetByKey("ProviderName") != null)
                {
                    connectionStringsSection.ConnectionStrings["QAT_BPS"].ConnectionString = Common.Configuration.GetInstance().GetByKey("ConnectionString_QAT_BPS");
                    connectionStringsSection.ConnectionStrings["QAT_BPS"].ProviderName     = Common.Configuration.GetInstance().GetByKey("ProviderName");
                    config.Save();
                    ConfigurationManager.RefreshSection("connectionStrings");
                }
            }
            catch (Exception ex)
            {
            }


            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
            ElementFactory elementFactory;
            string         pathOfElementXML = PathFinder.GetPath();

            pathOfElementXML += "\\HBLAutomationAPIs\\Resources\\ElementXML\\ElementFactory.xml";
            XmlSerializer serializer1 = new XmlSerializer(typeof(ElementFactory));
            XmlTextReader xmlReader1  = new XmlTextReader(pathOfElementXML);

            elementFactory = (ElementFactory)serializer1.Deserialize(xmlReader1);
            ContextPage.GetInstance().SetElement(elementFactory);
            string pathOfRRN = PathFinder.GetPath();

            pathOfRRN += "\\HBLAutomationAPIs\\Resources\\RRN_Generator\\RRN.txt";
            string[] RRN = File.ReadAllLines(pathOfRRN);
            ContextPage.GetInstance().Set_RRN(RRN[0]);
            ContextPage.GetInstance().Set_RRN_FetchDBCard(RRN[1]);
        }
        public static void InitialiseReport()
        {
            var htmlReporter = new ExtentHtmlReporter(@"C:\Users\BattJ\source\repos\NRLSAdapterAutomation\NRLSAdapterAutomation\Reports\ExtentReport.html");

            extent.AttachReporter(htmlReporter);
        }
Exemple #14
0
 static ExtentService()
 {
     var reporter = new ExtentHtmlReporter(@"C:\Users\RAS_T\source\repos\BladeDark\SeleniumTestCSharp\TestResults\index.html");
     reporter.Config.Theme = Theme.Dark;
     Instance.AttachReporter(reporter);
 }
Exemple #15
0
 public static void BeforeTestRun()
 {
     htmlReporter  = new ExtentHtmlReporter(@"/Users/chriselyn/Documents/MarsProjectReports/");
     extentReports = new ExtentReports();
     extentReports.AttachReporter(htmlReporter);
 }
Exemple #16
0
 public ExtentReportUtils(string htmlReportFileName)
 {
     extentHtmlReporter = new ExtentHtmlReporter(htmlReportFileName);
     extentReports      = new ExtentReports();
     extentReports.AttachReporter(extentHtmlReporter);
 }
        public void Cricket()
        {
            string imgName = DateTime.Now.ToString("dd/MM/yyyy-HH-mm-ss");

            ExtentHtmlReporter reporter = new ExtentHtmlReporter("./ReportsCricket/reports.html");

            var extend = new ExtentReports();

            extend.AttachReporter(reporter);

            var test = extend.CreateTest("stumped");

            IWebDriver driver = new ChromeDriver();

            driver.Navigate().GoToUrl("https://www.sportsadda.com/");

            driver.Manage().Window.Maximize();

            driver.FindElement(By.Id("cookiebtn")).Click();
            Thread.Sleep(5000);
            driver.FindElement(By.XPath("//div[@class='close']")).Click();


            /*driver.FindElement(By.XPath("/html/body/div[1]/footer/section/div[2]/div/div[2]/div[2]/div/div[2]/span[2]")).Click();
             * Thread.Sleep(2000);
             *
             * FunctionalLib.clickAction(driver, "identifierId", "Id");
             *
             * driver.FindElement(By.Id("identifierId")).SendKeys("*****@*****.**");
             *
             * //click on nextbutton
             * driver.FindElement(By.XPath("/html/body/div[1]/div[1]/div[2]/div[2]/div/div/div[2]/div/div[2]/div/div[1]/div/span/span")).Click();
             * Thread.Sleep(4000);
             *
             * //pwdfield
             * FunctionalLib.TypeAction(driver, "/html/body/div[1]/div[1]/div[2]/div[2]/div/div/div[2]/div/div[1]/div/form/span/section/div/div/div[1]/div[1]/div/div/div/div/div[1]/div/div[1]/input", "xpath", "ppsi1234");
             *
             * driver.FindElement(By.XPath("/html/body/div[1]/div[1]/div[2]/div[2]/div/div/div[2]/div/div[2]/div/div[1]/div/span/span")).Click();
             * Thread.Sleep(5000);*/



            driver.FindElement(By.XPath("//*[@id='c1330d14-5a19-479b-b72b-e1c649a7fff6']/div/div[2]/div[2]/nav/ul/li[2]/a/span")).Click();
            Thread.Sleep(2000);


            FunctionalLib.Scrollto(driver, "/html/body/div[1]/div/myapp/section[3]/div/div/div/div/section/div/div/div[1]/div/a");
            Thread.Sleep(2000);

            driver.FindElement(By.XPath("/html/body/div[1]/header/section[2]/div/div[2]/nav/ul/li[1]/a")).Click();
            Thread.Sleep(1000);

            var Cv = driver.FindElement(By.XPath("/html/body/div[1]/div/myapp/section[3]/div/div/div/div/section/div/div/div[1]/div/h2")).Text;
            var Cn = driver.FindElement(By.XPath("/html/body/div[1]/div/myapp/section[4]/div/div/div/div[1]/div/section[2]/div/div/div[1]/div/h2")).Text;
            var Cf = driver.FindElement(By.XPath("/html/body/div[1]/div/myapp/section[4]/div/div/div/div[1]/div/section[3]/div/div/div[1]/div/h2")).Text;
            var Co = driver.FindElement(By.XPath("/html/body/div[1]/div/myapp/section[4]/div/div/div/div[1]/div/section[4]/div/div/div[1]/div/h2")).Text;
            var Cs = driver.FindElement(By.XPath("/html/body/div[1]/div/myapp/section[4]/div/div/div/div[1]/div/section[5]/div/div/div[1]/div/h2")).Text;


            test.Log(Status.Pass, "Cricket Videos");

            for (int j = 2; j <= 5; j++)
            {
                Thread.Sleep(1000);

                FunctionalLib.Scrollto(driver, "/html/body/div[1]/div/myapp/section[4]/div/div/div/div[1]/div/section[" + j + "]/div/div/div[1]/div/a");
                Thread.Sleep(1000);

                driver.Navigate().Back();
                if (Cn.Equals("Cricket News"))
                {
                    if (j == 2)
                    {
                        test.Log(Status.Pass, "Cricket News");
                    }
                }

                if (Cf.Equals("Cricket Features"))
                {
                    if (j == 3)
                    {
                        test.Log(Status.Pass, "Cricket Features");
                    }
                }

                if (Co.Equals("Cricket Opinions"))
                {
                    if (j == 4)
                    {
                        test.Log(Status.Pass, "Cricket Opinions");
                    }
                }

                if (Cs.Equals("Cricket Social Buzz"))
                {
                    if (j == 5)
                    {
                        test.Log(Status.Pass, "Cricket Social Buzz");
                    }
                }
            }
            extend.Flush();
        }
 public static void BeforeTestRun()
 {
     _extentHtmlReporter = new ExtentHtmlReporter(@"C:\Data\log\");
     _extentReports      = new ExtentReports();
     _extentReports.AttachReporter(_extentHtmlReporter);
 }