Exemple #1
0
        public void TestReadExcel()
        {
            string xlPath = @"C:\Users\anushri.mundada\source\repos\SeleniumProject\TestData\FlightSearch.xlsx";

            Console.WriteLine(ExcelReaderHelper.GetCellData(xlPath, "Search", 2, 0));
            Console.WriteLine(ExcelReaderHelper.GetCellData(xlPath, "Search", 2, 1));
        }
        public void WhenUserEnterStartDateEndDateTimeAndDays()
        {
            var Startdate = ExcelReaderHelper.GetCellData(xlPath, "Sheet1", 1, 4);
            var Enddate   = ExcelReaderHelper.GetCellData(xlPath, "Sheet1", 1, 5);

            LinkHelper.ClickLink(By.XPath("//input[contains(@id,'mat-input-82')]"));
            TextBoxHelper.TypeInTexBox(By.XPath("//input[contains(@id,'mat-input-82')]"), Startdate.ToString());
            LinkHelper.ClickLink(By.XPath("//input[contains(@id,'mat-input-83')]"));
            TextBoxHelper.TypeInTexBox(By.XPath("//input[contains(@id,'mat-input-83')]"), Enddate.ToString());
            LinkHelper.ClickLink(By.Id("mat-select-9"));
            LinkHelper.ClickLink(By.XPath(""));
        }
        public void ExecuteScripts(string xlPath, string sheetName)
        {
            int totalRows = ExcelReaderHelper.GetTotalExcelColumns(xlPath, sheetName);

            for (int i = 1; i < totalRows; i++)
            {
                var keyword     = ExcelReaderHelper.GetCellData(xlPath, sheetName, i, _keywordCol).ToString();
                var locatorType = ExcelReaderHelper.GetCellData(xlPath, sheetName, i, _locatorTypeCol).ToString();
                var locatorVal  = ExcelReaderHelper.GetCellData(xlPath, sheetName, i, _locatorValueCol).ToString();
                var para        = ExcelReaderHelper.GetCellData(xlPath, sheetName, i, _parameterCol).ToString();
                PerformActions(keyword, locatorType, locatorVal, para);
            }
        }
Exemple #4
0
        public void TestBug()
        {
            string xlpath = @"C:\Users\anushri.mundada\source\repos\SeleniumProject\TestData\FlightSearch.xlsx";

            NavigationHelper.NavigateToUrl(ObjectRepository.Config.GetWebsite());
            HomePageusingFW hpage = new HomePageusingFW(ObjectRepository.Driver);
            LoginusingFW    lpage = hpage.NavigatetoLoginpopup();
            var             ePage = lpage.Login(ObjectRepository.Config.GetUserName(), ObjectRepository.Config.GetPassword());

            //            hpage.QuickSearch(TestContext.DataRow["Origin"].ToString(), TestContext.DataRow["Destination"].ToString());
            hpage.QuickSearch(ExcelReaderHelper.GetCellData(xlpath, "Search", 1, 0).ToString(), ExcelReaderHelper.GetCellData(xlpath, "Search", 1, 1).ToString());

            hpage.Logout();
        }
Exemple #5
0
        public void TestPage()
        {
            string xlPath = @"C:\Users\prade\source\Workspaces\Apply\UnitKubra\ExcelReader\kubra.xlsx";

            NavigationHelper.NavigateToUrl((string)ExcelReaderHelper.GetCellData(xlPath, "Sheet1", 1, 0));
            Enbridge enbridge = new Enbridge(ObjectRepository.driver);


            enbridge._ApplicationsLinkButton();
            enbridge._AdminConsoleLink();
            enbridge._UserLinkInAdminConsole();
            enbridge._SearchButtonInUserLink();
            enbridge._DatatablePresent();
            enbridge._CloseAdminConsoleWindow();
            enbridge.NavigateToBackToEnbridgeApplicationsPage();
        }
Exemple #6
0
        public void CreateBugDDF()
        {
            string xlPath = @"D:\Git\SeleniumWebdriver\DataFiles\DataForBug.xlsx";

            Console.WriteLine(ExcelReaderHelper.GetCellData(xlPath, "Sheet1", 0, 0));

            NavigationHelper.NavigationToURL(ObjectRepository.Config.GetWebsite());
            HomePage  hPage     = new HomePage(ObjectRepository.Driver);
            LoginPage loginPage = hPage.NavigateToLogin();
            BugDetail bugDetail = loginPage.LoginToPage(ObjectRepository.Config.GetUsername(), ObjectRepository.Config.GetPassword());

            bugDetail.SelectDropdownList(ExcelReaderHelper.GetCellData(xlPath, "Sheet1", 1, 0).ToString(),
                                         ExcelReaderHelper.GetCellData(xlPath, "Sheet1", 1, 1).ToString(), ExcelReaderHelper.GetCellData(xlPath, "Sheet1", 1, 2).ToString());
            bugDetail.FillInTextbox(ExcelReaderHelper.GetCellData(xlPath, "Sheet1", 1, 3).ToString(), ExcelReaderHelper.GetCellData(xlPath, "Sheet1", 1, 4).ToString());
            bugDetail.SubmitBug();
            hPage = bugDetail.Logout();
        }
        public void TestBugDdf()
        {
            string xlPath = @"C:\Development\Repos\FrameWorkSetUp\ExcelData.xlsx";

            NavigationHelper.NavigateToUrl(ObjectRepository.Config.GetWebsite());
            HomePage  hpPage    = new HomePage(ObjectRepository.Driver);
            LoginPage loginPage = hpPage.NavigateToLogin();
            var       ePage     = loginPage.Login(ObjectRepository.Config.GetUsername(), ObjectRepository.Config.GetPassword());

            //var bugPage = ePage.NavigateToDetail();
            //ePage.SelectFromCombo(TestContext.DataRow["Severity"].ToString(), TestContext.DataRow["HardWare"].ToString(), TestContext.DataRow["OS"].ToString());
            //ePage.TypeIn(TestContext.DataRow["Summary"].ToString(), TestContext.DataRow["Desc"].ToString());
            //ePage.ClickOnNew();
            ePage.SelectFromCombo(ExcelReaderHelper.GetCellData(xlPath, "TestExcelData", 1, 0).ToString(), ExcelReaderHelper.GetCellData(xlPath, "TestExcelData", 1, 1).ToString(), ExcelReaderHelper.GetCellData(xlPath, "TestExcelData", 1, 2).ToString());
            ePage.TypeIn(ExcelReaderHelper.GetCellData(xlPath, "TestExcelData", 1, 3).ToString(), ExcelReaderHelper.GetCellData(xlPath, "TestExcelData", 1, 4).ToString());
            ePage.Logout();
            Thread.Sleep(5000);
        }
Exemple #8
0
        public void WhenSelectClaimTypeDivisionDepartmentClaimStatusFiltesrAndClickOnTheRunNowButton()
        {
            var ApplicationRCDVDate = ExcelReaderHelper.GetCellData(xlPath, "Sheet1", 1, 2);
            var LeaveStartDate      = ExcelReaderHelper.GetCellData(xlPath, "Sheet1", 1, 3);

            LinkHelper.ClickLink(By.Id("mat-input-3"));

            TextBoxHelper.TypeInTexBox(By.Id("mat-input-3"), ApplicationRCDVDate.ToString());


            LinkHelper.ClickLink(By.Id("mat-input-4"));

            TextBoxHelper.TypeInTexBox(By.Id("mat-input-4"), LeaveStartDate.ToString());

            LinkHelper.ClickLink(By.XPath("//mat-select[contains(@id,'mat-select-2') or class='mat-select ng-tns-c14-51 ng-pristine ng-valid mat-select-empty ng-star-inserted ng-touched']"));

            LinkHelper.ClickLink(By.XPath("//span[text()='OP4315']"));

            cRpage.ClickOnRunNowButton();

            Thread.Sleep(5000);
        }
        public void HelpForm()
        {
            try
            {
                homePage.NavigateToSubMenu(homePage.WeAreWabashMenu, homePage.SupportSubMenu);

                supportPage = new SupportPage();
                supportPage.FillOutForm(ExcelReaderHelper.GetCellData(excelPath, 1, 0),
                                        ExcelReaderHelper.GetCellData(excelPath, 1, 1),
                                        ExcelReaderHelper.GetCellData(excelPath, 1, 2),
                                        ExcelReaderHelper.GetCellData(excelPath, 1, 3),
                                        ExcelReaderHelper.GetCellData(excelPath, 1, 4),
                                        ExcelReaderHelper.GetCellData(excelPath, 1, 5),
                                        ExcelReaderHelper.GetCellData(excelPath, 1, 6));
                supportPage.SubmitForm();

                if (supportPage.GetSuccessMessage() != null)
                {
                    actualMessage = supportPage.GetSuccessMessage();
                }
                else
                {
                    throw new Exception("Success message isn't present on the page");
                }
                Assert.AreEqual(supportPage.ExpectedMessage, actualMessage,
                                string.Format("Actual message: <{0}> is not equal to expected message: <{1}>", actualMessage, supportPage.ExpectedMessage));
                Logger.Info("ASSERT - Form completed successfuly");
            }
            catch (Exception exception)
            {
                GenericHelper.TakeScreenShot();
                Logger.Error(exception.Message);
                Logger.Error(exception.StackTrace);
                throw;
            }
        }
        public void VerifyDataInScheduleTable()
        {
            string title = ExcelReaderHelper.GetCellData(xlPath, "Sheet1", 1, 0).ToString();

            filter_Search.Click();
            filter_Search.SendKeys(ExcelReaderHelper.GetCellData(xlPath, "Sheet1", 1, 0).ToString());
            // Assert.AreEqual(TitleXpath.Text, ExcelReaderHelper.GetCellData(xlPath, "Sheet1", 1, 0));

            List <IWebElement> rows = new List <IWebElement>(driver.FindElements(By.TagName("tr")));

            Console.WriteLine(rows.Count);
            for (int i = 1; i < rows.Count(); i++)
            {
                String name = driver.FindElement(By.XPath("//table/tbody/tr[" + i + "]/td[1]")).Text;
                if (name.Contains(title))
                {
                    //JavaScriptExecutor.ScrollToAndClick(By.XPath("(//mat-icon[text()='delete'])[1]"));
                    //Thread.Sleep(2000);
                    //JavaScriptExecutor.ScrollToAndClick(By.XPath("//button[@color='primary' or @class='mat-raised-button mat-button-base mat-primary']//span[text()='Yes']"));

                    Assert.AreEqual(name, title);
                }
            }
        }
        public void EnterdataRecipientTextBox()
        {
            var RecipientId = ExcelReaderHelper.GetCellData(xlPath, "Sheet1", 1, 1);

            RecipientTextBox.SendKeys(RecipientId.ToString());
        }
        public void EnterDataIntitleTextBox()
        {
            var title = ExcelReaderHelper.GetCellData(xlPath, "Sheet1", 1, 0);

            TitleTextBox.SendKeys(title.ToString());
        }