public UsersPage VerifyUserInTheUserList(string VerifyRecord) { string UserNameInTable = "//table[@id='userTable']//td[@title='" + Username + "']"; commonFeatures.Search(Username); try { switch (VerifyRecord) { case "NoRecords": if (NoRecordsFound.Displayed) { ExtentReportUtil.report.Log(Status.Pass, "No Records found for -- " + Username); } break; case "RecordPresent": if (driver.FindElement(By.XPath(UserNameInTable)).Displayed) { ExtentReportUtil.report.Log(Status.Pass, "Searched -- <b>" + Username + "</b> is displayed in the User Table"); } break; default: break; } } catch (Exception ex) { ExtentReportUtil.report.Log(Status.Fail, "Exception occurred in VerifyUserInTheUserList() method -- " + ex.ToString()); } return(new UsersPage()); }
public void ClassifySession(string Resaon) { try { Type t = SensitiveWarning_XPath.GetType(); string name = t.Name; commonFeatures.ClickTab("Activities"); Wait(7); WaitForActivitiesPageToLoad(); SelectDateRange_Activities("Last 30 Days"); Wait(7); WaitForActivitiesPageToLoad(); commonFeatures.Search("View Session (1)"); commonFeatures.ClickViewSession(); Wait(10); ClickOn(Toggle_ClassifySession); Wait(1); EnterText(Input_ClassifyReason, Resaon); ClickOn(Btn_ClassifySubmit); VerifySessionClassified(); ClickReturnToActivities(); WaitForActivitiesPageToLoad(); commonFeatures.Search("View Session (1)"); } catch (Exception ex) { ExtentReportUtil.report.Log(Status.Fail, "Toggle Not working."); } }
public string CheckRenewalPeriod(string OrgName) { try { if (!commonFeatures.Search(OrgName)) { CreateOrganisation(OrgName); commonFeatures.Search(OrgName); } IWebElement lnk_Edit = driver.FindElement(By.XPath("//td[contains(text(),'" + OrgName + "')]/../td/a[text()='Edit']")); ClickOn(lnk_Edit); WaitForObject(lnk_Miscellaneous); if (!lnk_Miscellaneous.GetAttribute("class").Equals("active")) { ClickOn(lnk_Miscellaneous); WaitForObject(txt_RenewalPeriod); TakeScreenshot(); if (txt_RenewalPeriod.GetAttribute("value").Equals("30")) { ExtentReportUtil.report.Log(Status.Info, "The Renewal Period label is present with the default value 30."); } else { ExtentReportUtil.report.Log(Status.Info, "The Renewal Period label is present with the default value " + txt_RenewalPeriod.GetAttribute("value") + "."); } ClickOn(btn_Save); } } catch (Exception ex) { ExtentReportUtil.report.Log(Status.Error, "Exception Occured: " + ex.ToString()); } return(txt_RenewalPeriod.GetAttribute("value")); }
//[Ignore("NewEnvironment")] public void TC_132430_UpdateUserPassword() { string Admin_Username = testData.ReadData("Day0", "Admin_Username"); string Admin_Password = testData.ReadData("Day0", "Admin_Password"); string user_name = testData.ReadData("Day0", "user_name"); string newPass = testData.ReadData("Day0", "newPass"); loginPage.LoginToApplication(Admin_Username, Admin_Password); userPage.ChangeUserPassword(user_name, newPass); commonFeatures.Search(Admin_Username); activitiesPage.VerifyUserUpdatedInActivity(user_name); loginPage.LogOffFromApplication(); }
//Ignore("NewEnvironment")] public void TC_132569() { username = testData.ReadData("Day2", "Username"); password = testData.ReadData("Day2", "Password"); organisationName = testData.ReadData("Day2", "OrganisationName"); loginPage.LoginToApplication(username, password); Assert.True(orgPage.DeleteOrganisation(organisationName), "Unable to delete Organisation: " + organisationName); commonFeatures.ClickTab("Users"); Wait(5); commonFeatures.Search(username); usersPage.VerifyLogForDeletedOrganisation(username, organisationName); loginPage.LogOffFromApplication(); }
public void ValidateUserActivityLog(string username, string password) { //login Login(username, password); //userpage Wait(4); ClickOn(Link_UserTab); Wait(5); //click on activitylinnkFirst commonFeatures.Search("auto_temp_operator"); ClickOn(Link_FirstAcitvity); Wait(5); Highlight(Table_ActivityFirstRow); //Verify return activitybutton and click if (IsElementDisplayedNEnabled(Button_ReturnToActivities)) { ExtentReportUtil.Test.Log(Status.Pass, "Button displayed"); ClickOn(Button_ReturnToActivities); } else { ExtentReportUtil.Test.Log(Status.Fail, "Button NOT displayed:"); } //scenario2 Wait(3); Set_Textbox(Input_SearchUser, username); Wait(4); ClickOn(Link_FirstAcitvity); if (IsElementDisplayedNEnabled(Td_UserLoggedIn)) { ExtentReportUtil.Test.Log(Status.Pass, "Button displayed"); Highlight(Td_UserLoggedIn); } else { ExtentReportUtil.Test.Log(Status.Fail, "Button NOT displayed:"); } }