public void AddReportParameters() { Waits.WaitForElementToBePresent(txtFiscalYear1, WaitType.Large); StaticSleep(5000); Actions.Clear(txtFiscalYear1); Actions.SendKeys(txtFiscalYear1, ScenarioContext.Current["FiscalYear1"].ToString()); StaticSleep(5000); }
public void EnterReportDetails() { Waits.WaitForElementToBePresent(txtComments, WaitType.Large); StaticSleep(5000); Actions.Clear(txtComments); Actions.SendKeys(txtComments, ScenarioContext.Current["Comments"].ToString()); StaticSleep(5000); }
public NotesRecipientPage ClickOnSaveButtonFromNotePage() { Waits.WaitForElementToBePresent(_elementSavBtnFromNotePage, WaitType.Small); Actions.Click(_elementSavBtnFromNotePage); Console.WriteLine("Clicked on Save Button from Note Page successfully"); Thread.Sleep(500); return(CreateInstance <NotesRecipientPage>()); }
//This Method is for clicking on Upload Button From File Upload Page public DocumentsRecipientPage ClickOnUploadButtonFromFileUploadPage() { Waits.WaitForElementToBePresent(_ElementUploadButtonFromFileUploadPage, WaitType.Medium); if (Actions.IsEnabled(_ElementUploadButtonFromFileUploadPage)) { Actions.Click(_ElementUploadButtonFromFileUploadPage); } Console.WriteLine("Clicked on Upload Button From File Upload Page"); return(CreateInstance <DocumentsRecipientPage>()); }
//This method is for clicking on Save button from Note page public NotesDonorPage ClickOnSaveButtonFromNotePage() { if (Actions.IsDisplayed(_elementSavBtnFromNotePage)) { Waits.WaitForElementToBePresent(_elementSavBtnFromNotePage, WaitType.Small); Actions.Click(_elementSavBtnFromNotePage); Console.WriteLine("Clicked on Save Button from Note Page successfully"); } Thread.Sleep(1000);//this need to be removed later return(CreateInstance <NotesDonorPage>()); }
//This method is for Entering text in Description Box for Notes from Donor page public NotesDonorPage EnterTextInDescriptionBox(string TextForDescription, int NumbersRandom) { Waits.WaitForElementToBePresent(_ElementDescriptionBox, WaitType.Medium); if (Actions.IsEnabled(_ElementDescriptionBox)) { Actions.Click(_ElementDescriptionBox); Actions.FindElement(_ElementDescriptionBox).SendKeys(TextForDescription + "_" + NumbersRandom); } Console.WriteLine("Clciked on AddDocuments plus sign from the RecipientDetail page"); return(CreateInstance <NotesDonorPage>()); }
//Convert Unit id to Isbt public ProductHomePage ClickOnIsbtBtn() { if (Actions.IsDisplayed(_elementConvertToIsbt)) { Waits.WaitForElementToBePresent(_elementConvertToIsbt, WaitType.Large); //Thread.Sleep(500); Actions.Click(_elementConvertToIsbt); Console.WriteLine("Unit ID converted to Isbt"); } return(CreateInstance <ProductHomePage>()); }
//This Method is for Entering text in Note Box from Note page public NotesRecipientPage EnterTextInDescriptionBoxForNotes(String TextForDescription, int NumbersRandom) { Waits.WaitForElementToBePresent(_ElementDescriptionBoxForNotes, WaitType.Medium); if (Actions.IsEnabled(_ElementDescriptionBoxForNotes)) { Actions.Click(_ElementDescriptionBoxForNotes); Actions.FindElement(_ElementDescriptionBoxForNotes).SendKeys(TextForDescription + "_" + NumbersRandom); } Console.WriteLine("Text entered"); return(CreateInstance <NotesRecipientPage>()); }
//this method is used to search for a specific donor by first name and last name public DonorHomePage SearchDonorByFirstNameAndLastName(string firstName, string lastName) { Assert.True(Actions.IsDisplayed(_elementFirstnameField), "FirstName field is not being displayed"); Actions.SendKeys(_elementFirstnameField, firstName); Actions.SendKeys(_elementLastNameField, lastName); Console.WriteLine("The first name entered is " + firstName + " and the last name entered is " + lastName); Actions.Click(_elementSearchBtn); Waits.WaitForElementToBePresent(_elementDonorLinkInTable, WaitType.Small); Actions.Click(_elementDonorLinkInTable); Console.WriteLine("Page is being directed to donor home page"); return(CreateInstance <DonorHomePage>()); }
//This Method is for clicking on Document plus sign from donor page public void ClickOnAddDocumentsBtn(String TypeButton) { //Note, Document,ContentPlaceHolder1_btnAddNote,ContentPlaceHolder1_btnAddDocument By _elementDocuments = By.Id("ContentPlaceHolder1_btnAdd" + TypeButton + ""); if (Actions.IsEnabled(_elementDocuments)) { Waits.WaitForElementToBePresent(_elementDocuments, WaitType.Large); Actions.Click(_elementDocuments); } Console.WriteLine("Clicked on Add" + TypeButton + " plus sign from the RecipientDetail page"); }
public void ClearAppliedFilterOfReportGrid() { try { Waits.WaitForElementToBePresent(txtComments, WaitType.Large); Verify.ElementIsPresent(lnkClearFilters); Actions.Click(lnkClearFilters); } catch (Exception ex) { //Report.LogInfo("no filter is applied"); } }
//This Method is for clicking on Document & Note plus sign from RecipientDetail page public NotesDonorPage clickOnAddDocumentsBtn(String TypeButton) { //Thread.Sleep(6000); //ContentPlaceHolder1_btnAddNote //Note, Document,ContentPlaceHolder1_btnAddNote,ContentPlaceHolder1_btnAddDocument By _ElementDocuments = By.Id("ContentPlaceHolder1_btnAdd" + TypeButton + ""); if (Actions.IsEnabled(_ElementDocuments)) { Waits.WaitForElementToBePresent(_ElementDocuments, WaitType.Large); Actions.Click(_ElementDocuments); } Console.WriteLine("Clciked on Add" + TypeButton + " plus sign from the RecipientDetail page"); return(CreateInstance <NotesDonorPage>()); }
//This method is for file uploading in Documents from Donor page public object ChooseFileUploadDocsDonor() { object directoryName = ""; string filePath = AppContext.BaseDirectory; filePath = filePath.Replace(@"\Flux.TranstemLab\bin\Debug\", "\\Attachment\\Test Attachment.xlsx"); Waits.WaitForElementToBePresent(_elementChooseAFile, WaitType.Large); if (Actions.IsDisplayed(_elementChooseAFile)) { Actions.FindElement(_elementChooseAFile); Actions.SendKeys(_elementChooseAFile, filePath); } directoryName = new DirectoryInfo(filePath).Name; Console.WriteLine("File has been uploaded successsgully"); return(directoryName); }
public void AddSupportFormDetails() { Waits.WaitForElementToBePresent(txtFirstName, WaitType.Large); Waits.WaitForElementToBePresent(txtLastName, WaitType.Large); Waits.WaitForElementToBePresent(txtEmailAddress, WaitType.Large); Waits.WaitForElementToBePresent(txtMessage, WaitType.Large); Waits.WaitForElementToBePresent(txtSubject, WaitType.Large); Actions.Clear(txtFirstName); Actions.Clear(txtLastName); Actions.Clear(txtEmailAddress); Actions.Clear(txtSubject); Actions.Clear(txtMessage); Actions.SendKeys(txtFirstName, ScenarioContext.Current["FirstName"].ToString()); Actions.SendKeys(txtLastName, ScenarioContext.Current["LastName"].ToString()); Actions.SendKeys(txtEmailAddress, ScenarioContext.Current["EmailAddress"].ToString()); Actions.SendKeys(txtSubject, ScenarioContext.Current["Subject"].ToString()); Actions.SendKeys(txtMessage, ScenarioContext.Current["Message"].ToString()); StaticSleep(5000); }
public void UploadSignature() { Actions.Click(_elementUploadSignature); Console.WriteLine("Clicked on Upload Signature"); //object directoryName = ""; Console.WriteLine("Current Path is " + AppContext.BaseDirectory); string filePath = AppContext.BaseDirectory; filePath = filePath.Replace(@"\Flux.TranstemLab\bin\Debug\", "\\Attachment\\Signature.jpg"); Waits.WaitForElementToBePresent(_elementChooseFile, WaitType.Medium); if (Actions.IsDisplayed(_elementChooseFile)) { Actions.FindElement(_elementChooseFile).SendKeys(filePath); } // directoryName = new DirectoryInfo(filePath).Name; ClickOnUpload(); Console.WriteLine("File has been uploaded successfully"); }