protected override void ExecuteTestCase() { Reporter.Chapter.Title = "Clicks all the links in the webportal"; Step = "Login into web portal application"; CommonPage.NavigateTo(Driver, Reporter, Util.EnvironmentSettings["Server"]); CommonPage.Login(Driver, Reporter, UserName, Password); Step = "Select " + TestData["APPLICATIONNAME"] + " link from the navigation menu"; CommonPage.SelectApplication(Driver, Reporter, TestData["APPLICATIONNAME"]); Step = "Assert page title of " + TestData["TITLE"] + ""; CommonPage.AssertPageTitle(Driver, Reporter, TestData["TITLE"]); Step = "Get the menu count and menu names in " + "<b>" + TestData["APPLICATIONNAME"] + "</b>" + ""; menuCount = CommonPage.GetMenuCount(Driver, Reporter, TestData["APPLICATIONNAME"]); menuNames = CommonPage.GetMenuNames(Driver, Reporter, menuIndex, menuCount); Step = "Number of menu items in " + "<b>" + TestData["APPLICATIONNAME"] + "</b>" + " menu is:" + "<b>" + menuCount + "</b>" + ", Check below"; foreach (string menuItem in menuNames) { Step = (intiterator++) + ". Click the " + "<b>" + menuItem + "</b>" + " menu and click all sub menus under it"; CommonPage.ClickAllSubMenusInEachMenu(Driver, Reporter, resultsPath, menuItem, menuNames); } }
/// <summary> /// /// </summary> protected override void ExecuteTestCase() { Reporter.Chapter.Title = "Clicks all the links in the webportal"; Step = "Login into web portal application"; CommonPage.NavigateTo(Driver, Reporter, Util.EnvironmentSettings["Server"]); CommonPage.Login(Driver, Reporter, UserName, Password); Step = "Select " + TestData["APPLICATIONNAME"] + " link from the navigation menu"; CommonPage.SelectApplication(Driver, Reporter, TestData["APPLICATIONNAME"]); Step = "Assert page title of " + TestData["TITLE"] + ""; CommonPage.AssertPageTitle(Driver, Reporter, TestData["TITLE"]); int menuCount = CommonPage.GetMenuCount(Driver, Reporter, TestData["APPLICATIONNAME"]); for (int menu = 1; menu <= menuCount; menu++) { MenuNames.Add(CommonPage.GetMenuNames(Driver, Reporter, menu)); } Step = "Number of menu items in " + "<b>" + TestData["APPLICATIONNAME"] + "</b>" + "menu is:" + menuCount + ""; foreach (string menu in MenuNames) { Step = "Click on " + "<b>" + menu + "</b>" + " menu and click links under it"; CommonPage.ClickAllSubMenusInMenu(Driver, Reporter, resultsPath, menu); } }
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 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 "; CommonPage.ClickSubMenuLink(Driver, Reporter, menulist[i], submenulist[i], i, resultsPath); int count = 0; while (isTrueBool && count < 3) { if (CommonPage.IsMenuAnExternalApplication(Driver, Reporter, submenulist[i])) { Step = "Click " + externalapplicationsubmenulist[i] + " in " + externalapplicationmenulist[i] + " External Application Menu"; CommonPage.ClickExternalApplicationSubMenu(Driver, Reporter, externalapplicationmenulist[i], externalapplicationsubmenulist[i], i, resultsPath); } Step = "Click add new button"; CommonPage.ClickAddNewButton(Driver, Reporter); Step = "Close store popup window"; CommonPage.CloseStoreLocatorPopupWindow(Driver, Reporter, resultsPath); isTrueBool = submenulist[i + 1].Equals(submenulist[i]); i++; count++; } i--; isTrueBool = true; } catch (Exception ex) { if (ex.Message.Contains("Unable to locate element")) { this.Reporter.Chapter.Step.Action.IsSuccess = false; this.Reporter.Chapter.Step.Action.Extra = "Exception Message : " + ex.Message + "<br/>" + ex.InnerException + ex.StackTrace; break; } 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); } } }
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); } }