public void DoAdminSignout() { documentLibraryPage.MoveToUserActions(); wait.WaitForElementToBeClickable(documentLibraryPage.adminSignOutLink); documentLibraryPage.ClickOnAdminSignout(); wait.WaitforBrowserLoad(); wait.WaitForElementToDisplay(loginPage.userNameTxtBox); }
public void VerifyPageIsOpenSuccessfully(ORTMenu menuName) { switch (menuName) { case ORTMenu.Analysis: { Verify.ElementIsPresent(lnkAnalysis); Actions.Click(lnkAnalysis); Waits.WaitForElementToBeClickable(lnkAnalysis, WaitType.Medium); Verify.ElementIsPresent(lnkAnalysis); Verify.ExactTextInElementIs(lnkAnalysis, ORTConstants.ORTConstants.MenuAnalysis); break; } case ORTMenu.ContactSupport: { Verify.ElementIsPresent(lnkCustomerSupport); Actions.Click(lnkCustomerSupport); Waits.WaitForElementToBeClickable(lnkCustomerSupport, WaitType.Medium); Verify.ElementIsPresent(lnkCustomerSupport); Verify.ExactTextInElementIs(lnkCustomerSupport, ORTConstants.ORTConstants.MenuContactSupport); break; } case ORTMenu.Reports: { Verify.ElementIsPresent(lnkReport); Actions.Click(lnkReport); Waits.WaitForElementToBeClickable(lnkReport, WaitType.Medium); Verify.ElementIsPresent(lnkReport); Verify.ExactTextInElementIs(lnkReport, ORTConstants.ORTConstants.MenuReports); break; } } }
//this method is used to fill in the pop window and select a file path public void FillInFileUploadPopUp() { // Assert.True(Actions.IsDisplayed(_elementDescriptionFieldInPopUp), "Pop up window is not appeared"); //Thread.Sleep(1000); //WebDriverWait wait = new WebDriverWait(Driver, TimeSpan.FromSeconds(2)); Waits.WaitForElementToBeClickable(_elementCategoryDDLDocument, WaitType.Medium); //wait.Until(ExpectedConditions.ElementToBeClickable(_elementCategoryDDLDocument)); //Waits.WaitForPageLoad(); //Waits.WaitForPageLoad(); //Waits.WaitForElementToBePresent(_elementCategoryDDLDocument, WaitType.Medium); Actions.SendKeys(_elementCategoryDDLDocument, "Testing!"); Console.WriteLine("Testing! was entered in description"); Actions.SelectByRandoxIndex(_elementCategoryDDLDocument); object directoryName = ""; Console.WriteLine("Current Path is " + AppContext.BaseDirectory); string filePath = AppContext.BaseDirectory; filePath = filePath.Replace(@"\Flux.TranstemLab\bin\Debug\", "\\Attachment\\Test Attachment.xlsx"); //Waits.WaitForElementToBePresent(_elementChooseAFile, WaitType.Large); //Waits.WaitForPageLoad(); Waits.WaitForElementToBeClickable(_elementChooseAFile, WaitType.Large); // wait.Until(ExpectedConditions.ElementToBeClickable(_elementChooseAFile)); Actions.SendKeys(_elementChooseAFile, filePath); directoryName = new DirectoryInfo(filePath).Name; Console.WriteLine("File has been uploaded successfully"); }
public TranstemLabHomePage ClickLogOutName() { Waits.WaitForElementToBeClickable(_elementLogOutName, WaitType.ImplicitWaitTime); Actions.Click(_elementLogOutName); Console.WriteLine("Log Out Successful"); return(CreateInstance <TranstemLabHomePage>()); }
public AddUserPage ClickOnAddUser() { Waits.WaitForElementToBeClickable(_elementAddUser, WaitType.Small); Actions.Click(_elementAddUser); Console.WriteLine("Clicked on Add User link"); return(CreateInstance <AddUserPage>()); }
/// <summary> /// /// </summary> /// <returns> NA </returns> public void Temp(string UserName, string Password) { int attempt = 0; bool loginSuccess = false; ReAttempt: try { Waits.WaitForElementToBeClickable(txtUserName, WaitType.Medium); Actions.SendKeys(txtUserName, UserName); Actions.SendKeys(txtPassword, Password); if (Actions.ClickLogin(btnSignin)) { Waits.WaitForPageLoad(); loginSuccess = true; } } catch (Exception ex) { if (IsAlreadyLoggedIn()) { loginSuccess = true; } } if (attempt <= 3 && !loginSuccess) { attempt++; LaunchApplication(); //multiple attempts goto ReAttempt; } }
public UserMgmtPage ClickOnUserMgmt() { Waits.WaitForElementToBeClickable(_elementUserMgmt, WaitType.Small); Actions.Click(_elementUserMgmt); Console.WriteLine("Clicked on User Management link"); return(CreateInstance <UserMgmtPage>()); }
//For selecting report source and fiscal year public void SelectDataByText(By webElement, string value) { Verify.ElementIsPresent(webElement); Waits.WaitForElementToBeClickable(webElement, WaitType.Medium); // Actions.Click(webElement); Actions.SelectByVisibleText(webElement, value); StaticSleep(5000); }
//this method is used to fill in Date Performed public void FillInDatePerformedInMaintenance(string date) { //Thread.Sleep(1000); Waits.WaitForElementToBeClickable(_elementDatePerformed, WaitType.Medium); //wait.Until(ExpectedConditions.ElementToBeClickable(_elementDatePerformed)); Actions.FindElement(_elementDatePerformed).SendKeys(date); Console.WriteLine("Date Scheduled entered was " + date); }
public void EnterDataInInputBox(By webElement, string value) { Verify.ElementIsPresent(webElement); Waits.WaitForElementToBeClickable(webElement, WaitType.Medium); Actions.Clear(webElement); StaticSleep(3000); Actions.SendKeys(webElement, value); StaticSleep(3000); }
//this method opens the enviromnetal page public EnvironmentalMonitoringHomePage ClickOnEnvironmentalMonitoring() { Actions.Click(_elementQualityLink); Console.WriteLine("Quaility link is being clicked"); Waits.WaitForElementToBeClickable(_elementEnvironmentalMonitorningLink, WaitType.Medium); Actions.Click(_elementEnvironmentalMonitorningLink); Console.WriteLine("Navigated to environmental monitoring home page"); return(CreateInstance <EnvironmentalMonitoringHomePage>()); }
public RecipientPage ClickOnRecipientLink() { if (Actions.IsDisplayed(_elementRecipientsLink)) { Waits.WaitForElementToBeClickable(_elementRecipientsLink, WaitType.Small); Actions.Click(_elementRecipientsLink); } return(CreateInstance <RecipientPage>()); }
public void ClickOnUpload() { Waits.WaitForElementToBeClickable(_elementUpload, WaitType.Small); Actions.Click(_elementUpload); Console.WriteLine("Clicked on Upload button of Image Upload pop-up"); Waits.WaitForPageLoad(); Waits.WaitForPageLoad(); //Waits.WaitForElementToBeInvisible(_elementUpload, WaitType.Large); Console.WriteLine("Image Upload pop-up disappeared"); }
public RecipientSearchpage SearchForRecipient() { if (Actions.IsDisplayed(_elementRecipientsLink)) { Waits.WaitForElementToBeClickable(_elementRecipientsLink, WaitType.Small); Actions.Click(_elementRecipientsLink); } //Waits.WaitForPageLoad(); return(CreateInstance <RecipientSearchpage>()); }
public EquipmentSearchPage ClickOnEquipment() { if (Actions.IsDisplayed(_elementEquipmentAndConsumables)) { Actions.Click(_elementEquipmentAndConsumables); Waits.WaitForElementToBeClickable(_elementEquipmentSearch, WaitType.Small); Actions.Click(_elementEquipmentSearch); } return(CreateInstance <EquipmentSearchPage>()); }
public SearchBatchPage ClickOnBatchProcessing() { if (Actions.IsDisplayed(_elementProductsLink)) { Waits.WaitForElementToBeClickable(_elementProductsLink, WaitType.Small); Actions.Click(_elementProductsLink); Waits.WaitForElementToBeClickable(_elementProductsSearchLink, WaitType.Small); Actions.Click(_elementBatchProcessingLink); } return(CreateInstance <SearchBatchPage>()); }
public ProductSearchPage ClickOnProductToAdd() { if (Actions.IsDisplayed(_elementProductsLink)) { Waits.WaitForElementToBeClickable(_elementProductsLink, WaitType.Small); Actions.Click(_elementProductsLink); Waits.WaitForElementToBeClickable(_elementProductsSearchLink, WaitType.Small); Actions.Click(_elementProductsSearchLink); } return(CreateInstance <ProductSearchPage>()); }
//this method is used to open Preventive Maintenance window public void ClickOnAddPreventiveMaintenance() { //Thread.Sleep(1000); //WebDriverWait wait = new WebDriverWait(Driver, TimeSpan.FromSeconds(2)); // wait.Until(ExpectedConditions.ElementIsVisible(_elementAddPreventiveMaintenanceBtn)); Waits.WaitForPageLoad(); Waits.WaitForElementToBeClickable(_elementAddPreventiveMaintenanceBtn, WaitType.Large); //Waits.WaitForPageLoad(); Assert.True(Actions.IsDisplayed(_elementAddPreventiveMaintenanceBtn), "The add PM button is not shown"); Actions.Click(_elementAddPreventiveMaintenanceBtn); Console.WriteLine("Add Preventive Maintenance button is clicked"); }
//this method is used to finn in the pop window to add note public void FillInNotePopUp() { //WebDriverWait wait = new WebDriverWait(Driver, TimeSpan.FromSeconds(2)); Waits.WaitForElementToBeClickable(_elementCategoryDDLNote, WaitType.Medium); //wait.Until(ExpectedConditions.ElementToBeClickable(_elementCategoryDDLNote)); //Waits.WaitForElementToBeVisible(_elementCategoryDDLNote, WaitType.Medium); //Thread.Sleep(1000); Actions.SelectByIndex(_elementCategoryDDLNote, 1); Console.WriteLine(Actions.GetText(_elementCategoryDDLNote) + " is being selected in category dorp down "); Actions.SendKeys(_elementNoteField, "Testing!"); Console.WriteLine("Testing! is being entered in the Note field"); }
public SearchReagentPage ClickOnReagents() { //Thread.Sleep(2000); if (Actions.IsDisplayed(_elementEquipmentConsumablesLink)) { Waits.WaitForElementToBeClickable(_elementEquipmentConsumablesLink, WaitType.Small); Actions.Click(_elementEquipmentConsumablesLink); Waits.WaitForElementToBeClickable(_elementReagentsLink, WaitType.Small); Actions.Click(_elementReagentsLink); } return(CreateInstance <SearchReagentPage>()); }
//This method is for clicking on EntityManagement option from Home Page public CreatePhysiciansPage ClickOnEntityManagementForPhysicians() { if (Actions.IsDisplayed(_elementEntityManagement)) { Waits.WaitForElementToBeClickable(_elementEntityManagement, WaitType.Small); Actions.Click(_elementEntityManagement); Actions.Click(_elementPhysicians); Console.WriteLine("Physcians search is opened"); Waits.WaitForPageLoad(); } return(CreateInstance <CreatePhysiciansPage>()); }
public CreatePhysiciansPage ClickOnAddPhysiciansButton() { if (Actions.IsDisplayed(_elementAddPhyButton)) { Waits.WaitForElementToBeClickable(_elementAddPhyButton, WaitType.Large); Actions.Click(_elementAddPhyButton); if (Actions.IsDisplayed(_elementPhysiciansSaveButton)) { Console.WriteLine("Clicked on Add Facility Button "); } } return(CreateInstance <CreatePhysiciansPage>()); }
public DonorCollectionEventsPage ClickOnDonorLink() { if (Actions.IsDisplayed(_elementDonorsLink)) { Waits.WaitForElementToBeClickable(_elementDonorsLink, WaitType.Small); Actions.Click(_elementDonorsLink); if (Actions.IsDisplayed(_elementSerachButton)) { Console.WriteLine("Donor link is visible ======"); } } return(CreateInstance <DonorCollectionEventsPage>()); }
//this method is for open donor search page public DonorSearchPage ClickOnDonorLinkToSearch() { By _elementDonorsLink = By.XPath("//div[@id='cssmenu']//li/a[text()='Donors']"); if (Actions.IsDisplayed(_elementDonorsLink)) { Waits.WaitForElementToBeClickable(_elementDonorsLink, WaitType.Small); Actions.Click(_elementDonorsLink); if (Actions.IsDisplayed(_elementSerachButton)) { Console.WriteLine("Donor link is visible ======"); } } return(CreateInstance <DonorSearchPage>()); }
public void EnterOMBDetailsToCreateReport() { SelectDataByText(ddlReportSource, ScenarioContext.Current["ReportSource"].ToString()); //SelectDataByValue(ddlFiscalYear, "2016"); EnterDataInInputBox(ddlFiscalYear, ScenarioContext.Current["FiscalYear"].ToString()); SelectDataByText(ddlOMBDatabase, ScenarioContext.Current["OmbudsManagerDatabase"].ToString()); Verify.ElementIsPresent(chkSelectProgram); Waits.WaitForElementToBeClickable(chkSelectProgram, WaitType.Medium); Actions.Click(chkSelectProgram); Verify.ElementIsPresent(chkSelectProgram); EnterDataInInputBox(txtAnnuesWorkHrFte, ScenarioContext.Current["AnnualWorkHoursperFTE"].ToString()); EnterDataInInputBox(txtComments, ScenarioContext.Current["Comments"].ToString()); //Actions.SendKeys(txtComments, ScenarioContext.Current["Comments"].ToString()); StaticSleep(5000); }
//This method is for click on Save Button public DonorCollectionEventsPage ClickOnSaveButton() { Actions.Click(_elementDrCeUpdateBtn); if (Actions.IsDisplayed(_elementDrCeEditButton)) { Console.WriteLine("Update Button is clicked successfully"); Actions.Click(_elementDrCeSaveButton); //Thread.Sleep(5000); } //WebDriverWait wait = new WebDriverWait(Driver, TimeSpan.FromSeconds(5000)); //Waits.WaitForElementToBeInvisible(_elementDrCeSaveButton, WaitType.ImplicitWaitTime); //wait.Until(ExpectedConditions.InvisibilityOfElementLocated(_elementDrCeSaveButton)); Thread.Sleep(8000); Waits.WaitForElementToBeClickable(_elementAddCollectionEvent, WaitType.ImplicitWaitTime); //Waits.WaitForElementToBeInvisible(_elementDrCeSaveButton, WaitType.ImplicitWaitTime); return(CreateInstance <DonorCollectionEventsPage>()); }
public void CreateMaintenance(string date) { //WebDriverWait wait = new WebDriverWait(Driver, TimeSpan.FromSeconds(2)); //wait.Until(ExpectedConditions.ElementToBeClickable(_elementAddPreventiveMaintenanceBtn)); ClickOnAddPreventiveMaintenance(); Waits.WaitForElementToBeClickable(_elementDateScheduled, WaitType.Medium); //wait.Until(ExpectedConditions.ElementToBeClickable(_elementDateScheduled)); FillInDateScheduledInMaintenance(date); Waits.WaitForElementToBeClickable(_elementDateScheduled, WaitType.Medium); //wait.Until(ExpectedConditions.ElementToBeClickable(_elementDateScheduled)); FillNotesInAddMaintenanceSchedule(); Waits.WaitForElementToBeClickable(_elementSaveBtnAddPM, WaitType.Medium); //wait.Until(ExpectedConditions.ElementToBeClickable(_elementSaveBtnAddPM)); ClickOnSaveBtnInAddMaintenanceSchedule(); Waits.WaitForPageLoad(); //Waits.WaitForPageLoad(); }
public bool ClickOnAddCollectionEvent() { bool chkAddCollEvnts = false; //Thread.Sleep(2000); if (Actions.IsDisplayed(_elementDonorID)) { Waits.WaitForElementToBeClickable(_elementDonorID, WaitType.Small); Actions.Click(_elementAddCollectionEvent); chkAddCollEvnts = true; } if (Actions.IsDisplayed(_elementDrCollEvntsHeader)) { Console.WriteLine("Verifcation of Add Collection Event page is successful"); } return(chkAddCollEvnts); }
//this method is used to click on the save button in equipment home page public void ClickOnSaveBtnInEquipmentHomePage() { // WebDriverWait wait = new WebDriverWait(Driver, TimeSpan.FromSeconds(2)); Waits.WaitForElementToBeClickable(_elementSaveBtn, WaitType.Medium); // wait.Until(ExpectedConditions.ElementToBeClickable(_elementSaveBtn)); Assert.True(Actions.IsDisplayed(_elementSaveBtn), "Save button is not being displayed"); //Thread.Sleep(3000); Actions.FindElement(_elementSaveBtn).Click(); Console.WriteLine("Equipment is being saved"); /* * // The things we do to remove Thread.Sleep... * for (int i = 0; i < 10; i++) * { * Waits.WaitForPageLoad(); * }*/ //Thread.Sleep(3000); }
/// <summary> /// /// </summary> /// <param name="status"></param> public void SelectReportSourceFromFilter(ReportStatus status) { switch (status) { case ReportStatus.Certified: { Actions.Click(lnkAnalysis); Waits.WaitForPageLoad(); break; break; } case ReportStatus.InProgress: { Verify.ElementIsPresent(lnkCustomerSupport); Actions.Click(lnkCustomerSupport); Waits.WaitForElementToBeClickable(lnkCustomerSupport, WaitType.Medium); Verify.ElementIsPresent(lnkCustomerSupport); Verify.ExactTextInElementIs(lnkCustomerSupport, ORTConstants.ORTConstants.MenuContactSupport); break; } case ReportStatus.Locked: { Verify.ElementIsPresent(lnkReport); Actions.Click(lnkReport); Waits.WaitForElementToBeClickable(lnkReport, WaitType.Medium); Verify.ElementIsPresent(lnkReport); Verify.ExactTextInElementIs(lnkReport, ORTConstants.ORTConstants.MenuReports); break; } case ReportStatus.Verified: { Verify.ElementIsPresent(lnkReport); Actions.Click(lnkReport); Waits.WaitForElementToBeClickable(lnkReport, WaitType.Medium); Verify.ElementIsPresent(lnkReport); Verify.ExactTextInElementIs(lnkReport, ORTConstants.ORTConstants.MenuReports); break; } } }