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); while (isTrueBool) { 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); } isTrueBool = submenulist[i + 1].Equals(submenulist[i]); Step = "Enter Store Number and Click on Search Button"; CommonPage.TypeStoreNumber(Driver, Reporter, TestData["STORENUMBER"]); CommonPage.ClickSearchButton(Driver, Reporter, resultsPath); VerifyResults(); 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>"; CommonPage.ClickSubMenuLink(Driver, Reporter, menulist[i], submenulist[i], i, resultsPath); if (CommonPage.IsMenuAnExternalApplication(Driver, Reporter, submenulist[i])) { while (isTrueBool) { Step = "<i>" + (i + 1) + ":" + " Click the following external application menu " + "<b>" + externalapplicationmenulist[i] + "</b>" + ">>" + "<b>" + externalapplicationsubmenulist[i] + "</b>" + "</i>"; CommonPage.ClickExternalApplicationSubMenu(Driver, Reporter, externalapplicationmenulist[i], externalapplicationsubmenulist[i], i, resultsPath); CommonPage.ClickSearchButton(Driver, Reporter, resultsPath); VerifyResults(); Selenide.SwitchToDefaultContent(Driver); if (i + 1 < submenulist.Count) { isTrueBool = submenulist[i + 1].Equals(submenulist[i]); } i++; } i--; isTrueBool = true; } } catch (Exception ex) { CommonPage.AcceptOrDissmissAlertIfPresent(Driver, Reporter); CommonPage.AcceptErrorMessageIfPresent(Driver, Reporter, resultsPath); CommonPage.CloseBrowserNewTab(Driver); } } }