コード例 #1
0
        public void ThenUserCanCompareColumnOfDownloadedXlsxFile()
        {
            string pendRenDownXlpath = @"C:\Users\Anuruddha.Tiwari\Downloads\quadrantThree.xlsx";

            try
            {
                string s1 = ActivityHomePage.BillingNameHeader(SelectBrowser.driver).Text;
                Assert.IsTrue(ExcelRead.GetCellData(pendRenDownXlpath, @"Pending Renewals", 0, 0).Contains(s1));

                test.Info("Assert pass successfully for compare the 1st column header with respect to present header under Pending Renewals");

                string s2 = ActivityHomePage.PubCodeHeader(SelectBrowser.driver).Text;
                Assert.IsTrue(ExcelRead.GetCellData(pendRenDownXlpath, @"Pending Renewals", 0, 1).Contains(s2));

                test.Info("Assert pass successfully for compare the 2nd column header with respect to present header under Pending Renewals");

                string s3 = ActivityHomePage.ContractEndHeader(SelectBrowser.driver).Text;
                Assert.IsTrue(ExcelRead.GetCellData(pendRenDownXlpath, @"Pending Renewals", 0, 2).Contains(s3));

                test.Info("Assert pass successfully for compare the 3rd column header with respect to present header under Pending Renewals");


                string s4 = ActivityHomePage.ContractAmountHeader(SelectBrowser.driver).Text;
                Assert.IsTrue(ExcelRead.GetCellData(pendRenDownXlpath, @"Pending Renewals", 0, 3).Contains(s4));

                test.Info("Assert pass successfully for compare the 4th column header with respect to present header under Pending Renewals");


                string s5 = ActivityHomePage.SalesCloseHeader(SelectBrowser.driver).Text;
                Assert.IsTrue(ExcelRead.GetCellData(pendRenDownXlpath, @"Pending Renewals", 0, 4).Contains(s5));

                test.Info("Assert pass successfully for compare the 5th column header with respect to present header under Pending Renewals");
                //Console.WriteLine("Assert pass for all 5 headers");
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception==>" + ex);
                ScreenshotPage.TakesScreenshotWithDate(@"Screesnhot", System.Drawing.Imaging.ImageFormat.Png);
            }
        }