/// <summary>
 /// CloseStoreLocatorPopupWindow clicks on close icon of doctors entry popup
 /// </summary>
 /// <param name="Driver">Initialized RemoteWebDriver instance</param>
 /// <param name="reporter"></param>
 public static void CloseStoreLocatorPopupWindow(RemoteWebDriver driver, Iteration reporter, string resultsPath)
 {
     try
     {
         reporter.Add(new Act("Close Store Locator Popup Window"));
         //Selenide.SwitchToDefaultContent(driver);
         //Selenide.SwitchToFrame(driver, Locator.Get(LocatorType.ID, "dlg_ifrm_search"));
         Selenide.WaitForElementNotVisible(driver, Locator.Get(LocatorType.ClassName, "dlg_spinner"));
         if (Selenide.IsElementExists(driver, Locator.Get(LocatorType.ID, "createmsgdiv")))
         {
             CommonPage.AcceptErrorMessageIfPresent(driver, reporter, resultsPath);
         }
         //if (Selenide.IsElementExists(driver, Util.GetLocator("Cancel_btn")))
         //{
         //    Selenide.Click(driver, Util.GetLocator("Cancel_btn"));
         //}
         if (Selenide.IsElementExists(driver, Util.GetLocator("StoreInfoCloseBtn_win")))
         {
             Selenide.Click(driver, Util.GetLocator("StoreInfoCloseBtn_win"));
         }
         //CommonPage.WaitUntilSpinnerDisappears(driver);
         //CommonPage.AcceptOrDissmissAlertIfPresent(driver, reporter);
         //CommonPage.AcceptErrorMessageIfPresent(driver);
         Selenide.SwitchToDefaultContent(driver);
     }
     catch (Exception ex)
     {
         CommonPage.AcceptOrDissmissAlertIfPresent(driver, reporter);
         CommonPage.AcceptErrorMessageIfPresent(driver, reporter, resultsPath);
     }
 }
 /// <summary>
 /// CloseCostCenterPopUp method closes Patient Information Poup in Scheduler Page
 /// </summary>
 /// <param name="driver"></param>
 /// <param name="reporter"></param>
 public static void CloseCostCenterPopUp(RemoteWebDriver driver, Iteration reporter)
 {
     reporter.Add(new Act("Close Patient Information Poup in Scheduler Page"));
     Selenide.SwitchToDefaultContent(driver);
     Selenide.JS.Click(driver, Locator.Get(LocatorType.XPath,
                                           string.Format(@"//img[@title='Close']")));
 }
Example #3
0
 public void ClickOnResults()
 {
     if (Selenide.IsElementExists(Driver, Util.GetLocator("ResultsTable_frm")))
     {
         Selenide.SwitchToFrame(Driver, Util.GetLocator("ResultsTable_frm"));
         if (Selenide.IsElementExists(Driver, Util.GetLocator("ResultsTable1_tbl")))
         {
             Step = "Click on any store number";
             StoreSchedulerPage.ClickOnAnyStoreNumber(Driver, Reporter, resultsPath);
         }
         else if (Selenide.IsElementExists(Driver, Util.GetLocator("ResultsTable2_tbl")))
         {
             Step = "Click on any store number";
             StoreSchedulerPage.ClickOnAnyStoreNumber(Driver, Reporter, resultsPath);
         }
         if (Selenide.IsElementExists(Driver, Util.GetLocator("StoreInfoPopUp_win")))
         {
             Step = "Close store popup window";
             StoreSchedulerPage.CloseStoreLocatorPopupWindow(Driver, Reporter, resultsPath);
         }
         else
         {
             Step = "No Results Found";
             Selenide.SwitchToDefaultContent(Driver);
         }
     }
 }
        protected override void ExecuteTestCase()
        {
            Reporter.Chapter.Title = "Verifying the functaionality of External Application Module";
            Step = "Login into Web Portal Application";
            CommonPage.NavigateTo(Driver, Reporter, Util.EnvironmentSettings["Server"]);
            CommonPage.Login(Driver, Reporter, UserName, Password);

            //Select Application from the menu popup.
            Step = "Select " + TestData["APPLICATIONNAME"] + " application from the menu popup.";
            CommonPage.SelectApplication(Driver, Reporter, TestData["APPLICATIONNAME"]);

            //Assert page title of the application.
            Step = "Assert Page Title of " + TestData["PAGETITLE"] + " the application";
            CommonPage.AssertPageTitle(Driver, Reporter, TestData["PAGETITLE"]);

            //Click submenu.

            for (int i = 0; i < menulist.Count; i++)
            {
                try
                {
                    Step = (i + 1) + ":" + " Click>>" + submenulist[i] + " in " + menulist[i] + " menu ";
                    //AmericaBestHomePage.ClickOnMenu(Driver, Reporter, menulist[i]);
                    CommonPage.ClickSubMenuLink(Driver, Reporter, menulist[i], submenulist[i], i, resultsPath);
                    while (isTrueBool)
                    {
                        if (AmericaBestHomePage.IsMenuAnExternalApplication(Driver, Reporter, submenulist[i]))
                        {
                            //Step = "Click " + externalapplicationmenulist[i] + " in " + submenulist[i] + " Menu";
                            //AmericaBestHomePage.ClickExternalApplicationMenu(Driver, Reporter, externalapplicationmenulist[i],i);
                            Step = "Click " + externalapplicationsubmenulist[i] + " in " + externalapplicationmenulist[i] + " External Application Menu";
                            AmericaBestHomePage.ClickExternalApplicationSubMenu(Driver, Reporter, externalapplicationmenulist[i], externalapplicationsubmenulist[i], i, resultsPath);
                        }
                        Step = "Enter Store Number and Click on Search Button";
                        StoreSchedulerPage.TypeStoreNumber(Driver, Reporter, TestData["STORENUMBER"]);
                        StoreSchedulerPage.ClickSearchButton(Driver, Reporter, resultsPath);
                        ClickOnResults();
                        Selenide.SwitchToDefaultContent(Driver);
                        if (submenulist.Count > i + 1)
                        {
                            isTrueBool = submenulist[i + 1].Equals(submenulist[i]);
                            i++;
                        }
                        else
                        {
                            isTrueBool = false;
                        }
                    }
                    i--;
                    isTrueBool = true;
                }
                catch (Exception ex)
                {
                    CommonPage.AcceptOrDissmissAlertIfPresent(Driver, Reporter);
                    CommonPage.AcceptErrorMessageIfPresent(Driver, Reporter, resultsPath);
                    CommonPage.CloseBrowserNewTab(Driver);
                }
            }
        }
        protected override void ExecuteTestCase()
        {
            Reporter.Chapter.Title = "Verifying test results without any search parameter";
            Step = "Login into Web Portal Application";
            CommonPage.NavigateTo(Driver, Reporter, Util.EnvironmentSettings["Server"]);
            CommonPage.Login(Driver, Reporter, UserName, Password);

            //Select Application from the menu popup.
            Step = "Select " + TestData["APPLICATIONNAME"] + " application from the menu popup.";
            CommonPage.SelectApplication(Driver, Reporter, TestData["APPLICATIONNAME"]);

            //Assert page title of the application.
            Step = "Assert Page Title of " + TestData["PAGETITLE"] + " the application";
            CommonPage.AssertPageTitle(Driver, Reporter, TestData["PAGETITLE"]);

            //Click submenu.
            for (int i = 0; i < menulist.Count; i++)
            {
                try
                {
                    // To click the menu and submenu under it
                    Step = (i + 1) + ":" + " Click the following navigation: " + "<i>" + menulist[i] + "</i>" + ">>" + "<i>" + submenulist[i] + "</i>";
                    //AmericaBestHomePage.ClickOnMenu(Driver, Reporter, menulist[i]);
                    CommonPage.ClickSubMenuLink(Driver, Reporter, menulist[i], submenulist[i], i, resultsPath);
                    while (isTrueBool)
                    {
                        if (AmericaBestHomePage.IsMenuAnExternalApplication(Driver, Reporter, submenulist[i]))
                        {
                            //Step = "Click " + externalapplicationmenulist[i] + " in " + submenulist[i] + " Menu";
                            //AmericaBestHomePage.ClickExternalApplicationMenu(Driver, Reporter, externalapplicationmenulist[i],i);

                            Step = (i + 1) + ":" + " Click the following external application menu " + "<b>" + externalapplicationmenulist[i] + "</b>" + ">>" + "<b>" + externalapplicationsubmenulist[i] + "</b>";
                            AmericaBestHomePage.ClickExternalApplicationSubMenu(Driver, Reporter, externalapplicationmenulist[i], externalapplicationsubmenulist[i], i, resultsPath);
                        }
                        if (i + 1 < submenulist.Count)
                        {
                            isTrueBool = submenulist[i + 1].Equals(submenulist[i]);
                        }
                        StoreSchedulerPage.ClickSearchButton(Driver, Reporter, resultsPath);
                        ClickOnResults();
                        Selenide.SwitchToDefaultContent(Driver);
                        i++;
                    }
                    i--;
                    isTrueBool = true;
                }
                catch (Exception ex)
                {
                    CommonPage.AcceptOrDissmissAlertIfPresent(Driver, Reporter);
                    CommonPage.AcceptErrorMessageIfPresent(Driver, Reporter, resultsPath);
                    CommonPage.CloseBrowserNewTab(Driver);
                }
            }
        }
        /// <summary>
        /// VerifyTabsInCostCenterPopUp verfies tabs in cost center popup
        /// </summary>
        /// <param name="driver"></param>
        /// <param name="reporter"></param>

        public static void VerifyTabsInCostCenterPopUp(RemoteWebDriver driver, Iteration reporter)
        {
            reporter.Add(new Act("Switch to cost center popup window"));
            reporter.Add(new Act("Click on each tab in the cost center popup window"));
            Selenide.SwitchToDefaultContent(driver);
            Selenide.SwitchToFrame(driver, Locator.Get(LocatorType.ID, "dlg_ifrm_search"));
            int index = Selenide.GetElementCount(driver, Locator.Get(LocatorType.XPath,
                                                                     "//div[@id='tab_ctrl']/ul/li"));

            for (int tab = 1; tab <= index; tab++)
            {
                Selenide.JS.Click(driver, Locator.Get(LocatorType.XPath,
                                                      string.Format(@"//div[@id='tab_ctrl']/ul/li[{0}]/a/span", tab)));
            }
        }
        protected override void ExecuteTestCase()
        {
            try
            {
                Reporter.Chapter.Title = "Verifying the functaionality of External Application Module";
                Step = "Login into Web Portal Application";
                CommonPage.NavigateTo(Driver, Reporter, Util.EnvironmentSettings["Server"]);
                CommonPage.Login(Driver, Reporter, UserName, Password);

                //Select Application from the menu popup.
                Step = "Select " + TestData["APPLICATIONNAME"] + " application from the menu popup.";
                CommonPage.SelectApplication(Driver, Reporter, TestData["APPLICATIONNAME"]);

                //Assert page title of the application.
                Step = "Assert Page Title of " + TestData["PAGETITLE"] + " the application";
                CommonPage.AssertPageTitle(Driver, Reporter, TestData["PAGETITLE"]);

                //Click submenu.

                for (int i = 0; i < menulist.Count(); i++)
                {
                    Step = (i + 1) + ":" + " Click" + submenulist[i] + " in " + menulist[i] + " menu ";
                    AmericaBestHomePage.ClickOnMenu(Driver, Reporter, menulist[i]);
                    AmericaBestHomePage.ClickSubMenuLink(Driver, Reporter, menulist[i], submenulist[i], i);
                    if (AmericaBestHomePage.IsMenuAnExternalApplication(Driver, Reporter, submenulist[i]))
                    {
                        //Step = "Click " + externalapplicationmenulist[i] + " in " + submenulist[i] + " Menu";
                        //AmericaBestHomePage.ClickExternalApplicationMenu(Driver, Reporter, externalapplicationmenulist[i], i);
                        Step = "Click " + externalapplicationsubmenulist[i] + " in " + externalapplicationmenulist[i] + " External Application Menu";
                        AmericaBestHomePage.ClickExternalApplicationSubMenu(Driver, Reporter, externalapplicationmenulist[i], externalapplicationsubmenulist[i], i);
                    }
                    Step = "Enter Store Number and Click on Search Button";
                    StoreSchedulerPage.TypeStoreNumber(Driver, Reporter, TestData["STORENUMBER"]);
                    StoreSchedulerPage.ClickSearchButton(Driver, Reporter);
                    ClickOnResults();
                    Selenide.SwitchToDefaultContent(Driver);
                }
            }
            catch (SystemException sysex)
            {
                //    this.Reporter.Chapter.Step.Action.Extra = sysex.Message + "<br/>" + sysex.StackTrace;
                //    Reporter.Chapter.Step.Action.IsSuccess = false;
                CommonPage.AcceptOrDissmissAlertIfPresent(Driver, Reporter);
                CommonPage.AcceptErrorMessageIfPresent(Driver);
            }
        }
 public void VerifyResults()
 {
     if (Selenide.IsElementExists(Driver, Util.GetLocator("ResultsTable_frm")))
     {
         Selenide.SwitchToFrame(Driver, Util.GetLocator("ResultsTable_frm"));
         if (Selenide.IsElementExists(Driver, Util.GetLocator("ResultsTable1_tbl")))
         {
             Step = "Results Found";
         }
         else if (Selenide.IsElementExists(Driver, Util.GetLocator("ResultsTable2_tbl")))
         {
             Step = "Results Found";
         }
         else
         {
             Step = "No Results Found";
             Selenide.SwitchToDefaultContent(Driver);
         }
     }
 }
Example #9
0
 /// <summary>
 /// SelectApplication method selects the application at login screen
 /// </summary>
 /// <param name="Driver">Initialized RemoteWebDriver instance</param>
 /// <param name="applicationName">Link Name</param>
 public static void SelectApplication(RemoteWebDriver driver, Iteration reporter, string applicationName)
 {
     reporter.Add(new Act(String.Format("Select the {0} link ", applicationName)));
     Selenide.SwitchToFrame(driver, Locator.Get(LocatorType.ID, "dlg_ifrm_modal2"));
     try
     {
         Actions     action      = new Actions(driver);
         IWebElement application = Selenide.GetElement(driver, Locator.Get(LocatorType.XPath, string.Format(@"//table[@id='tblSelect']/descendant::a[contains(@title,""{0}"")]/div", applicationName)));
         //Selenide.Click(driver,Locator.Get(LocatorType.XPath, string.Format(@"//table[@id='tblSelect']/descendant::a[contains(@title,""{0}"")]/div", applicationName)));
         //Selenide.Click(driver, Locator.Get(LocatorType.XPath, string.Format(@"//table[@id='tblSelect']/descendant::a[contains(@title,'{0}')]/div", applicationName)));
         action.MoveToElement(application).Click().Build().Perform();
         WaitForPageLoad(driver, 10);
         Selenide.WaitForElementNotVisible(driver, Locator.Get(LocatorType.ClassName, "dlg_spinner"));
         Selenide.SwitchToDefaultContent(driver);
     }
     catch (Exception ex)
     {
         throw new Exception(String.Format("{ 0 } link not found in the website", applicationName));
     }
 }
        /// <summary>
        /// ClickOnAnyStoreNumber method clicks on store number in the results
        /// </summary>
        /// <param name="driver"></param>
        /// <param name="reporter"></param>
        /// <param name="resultsPath"></param>
        public static void ClickOnAnyStoreNumber(RemoteWebDriver driver, Iteration reporter, string resultsPath)
        {
            try
            {
                reporter.Add(new Act("Click on store number in results of Stores Directory Page"));
                //Selenide.SwitchToFrame(driver, Locator.Get(LocatorType.ID, "iFrameSiteContents"));
                if (Selenide.IsElementExists(driver, Locator.Get(LocatorType.XPath, "//table[@class='formview']/descendant::tr[2]/td//a/nobr")))
                {
                    Selenide.Click(driver, Locator.Get(LocatorType.XPath, ("//table[@class='formview']/descendant::tr[2]/td//a/nobr")));
                }
                else if (Selenide.IsElementExists(driver, Locator.Get(LocatorType.XPath, "//table[@class='formview']/descendant::tr[2]/td//a")))
                {
                    Selenide.Click(driver, Locator.Get(LocatorType.XPath, ("//table[@class='formview']/descendant::tr[2]/td//a")));
                }
                else
                {
                    reporter.Add(new Act("Results not found"));
                }

                Selenide.WaitForElementNotVisible(driver, Locator.Get(LocatorType.ClassName, "dlg_spinner"));
                //WaitForPageLoad(driver, 10);
                //CommonPage.WaitUntilSpinnerDisappears(driver);
                CommonPage.AcceptOrDissmissAlertIfPresent(driver, reporter);
                CommonPage.AcceptErrorMessageIfPresent(driver, reporter, resultsPath);
                //Selenide.SwitchToFrame(driver,Locator.Get(LocatorType.ID, "dlg_ifrm_search"));
                Selenide.SwitchToDefaultContent(driver);
            }

            catch (SystemException sysex)
            {
                //    this.Reporter.Chapter.Step.Action.Extra = sysex.Message + "<br/>" + sysex.StackTrace;
                //    Reporter.Chapter.Step.Action.IsSuccess = false;
                CommonPage.AcceptOrDissmissAlertIfPresent(driver, reporter);
                CommonPage.AcceptErrorMessageIfPresent(driver, reporter, resultsPath);
            }
        }
Example #11
0
 public void ClickOnResults()
 {
     if (Selenide.IsElementExists(Driver, Util.GetLocator("ResultsTable_frm")))
     {
         try
         {
             Selenide.SwitchToFrame(Driver, Util.GetLocator("ResultsTable_frm"));
             if (Selenide.IsElementExists(Driver, Util.GetLocator("ResultsTable1_tbl")))
             {
                 Step = "Click on any store number";
                 StoreSchedulerPage.ClickOnAnyStoreNumber(Driver, Reporter);
             }
             else if (Selenide.IsElementExists(Driver, Util.GetLocator("ResultsTable2_tbl")))
             {
                 Step = "Click on any store number";
                 StoreSchedulerPage.ClickOnAnyStoreNumber(Driver, Reporter);
             }
             if (Selenide.IsElementExists(Driver, Util.GetLocator("StoreInfoPopUp_win")))
             {
                 Step = "Close store popup window";
                 StoreSchedulerPage.CloseStoreLocatorPopupWindow(Driver, Reporter);
             }
             else
             {
                 Step = "No Results Found";
                 Selenide.SwitchToDefaultContent(Driver);
             }
         }
         catch (Exception ex)
         {
             CommonPage.AcceptOrDissmissAlertIfPresent(Driver, Reporter);
             CommonPage.AcceptErrorMessageIfPresent(Driver);
             CommonPage.CloseBrowserNewTab(Driver);
         }
     }
 }