public void Common_methods() { Global.Driver.wait(5); //Click on the Owners tab Ownertab.Click(); //Click MyRequest tab MyRequesttab.Click(); // CLick AddRequest tab AddRequesttab.Click(); // CLick Duedate tab DueDate.Click(); //send keys Description Description.SendKeys(ExcelLib.ReadData(3, "TestData")); //click savebutton SaveButton.Click(); //click owner again Ownertab2.Click(); //My Request again MyRequesttab2.Click(); //Enter the value in the search bar SearchBar.SendKeys("Added for verification"); Global.Driver.wait(5); //Click on the search button SearchButton.Click(); }
public void Common_methods() { Global.Driver.wait(5); //Click on the Owners tab Tenanttab.Click(); //Click MyRequest tab MyRequesttab.Click(); //click add request tab Addrequesttab.Click(); //click Select property SelectProperty.Click(); //select dropdown SelectPropertydropdown.Click(); //Type dropdown TypeDropDown.Click(); TypeOption.Click(); Message.SendKeys(ExcelLib.ReadData(3, "TestData")); SaveButton.Click(); Tenanttab2.Click(); MyRequesttab2.Click(); //Enter the value in the search bar SearchBar.SendKeys("automate test for verification"); Global.Driver.wait(5); //Click on the search button SearchButton.Click(); }
public void EditReservationWithValidData(int userId) { //Get user e-mail needed for Reservation button locator var currentUser = _userRepository.GetUserById(userId); _userEmail = currentUser.Email.ToString(); EditUserReservationButton.Click(); //Get screening id for current user's reservation for Date drop-down menu locator var currentScreening = _screeningRepository.GetScreeningById(_returnedScreeningId); _userScreeningDate = currentScreening.DateTime.ToString("dd.MM.yyyy"); DateDropDownMenu.Click(); //Set time for Time drop-down menu locator _userScreeningTime = currentScreening.DateTime.ToString("HH:mm:ss"); TimeDropDownMenu.Click(); //Enough Seats Number Check bool screeningCheck = _screeningRepository.EnoughtSeatsNumberCheck(_returnedScreeningId); if (screeningCheck == false) { _screeningRepository.CreateMoreSeatsForThisScreening(_returnedScreeningId); } NumberOfPeopleDropDownMenu.Click(); SaveButton.Click(); }
public void EditQuestion(Question question) { Question.Type(question.Name); SetCheckBox(QuestionRequiredCheckbox, question.Required); System.Threading.Thread.Sleep(1000); SaveButton.Click(); }
public void ValidateNewInformation(UserDto user) { Helper.ScrollToSeeTheRightButton(_driver, SaveButton); OldPasswordField.Click(); var oldPasswordValue = user.GetType().GetRuntimeProperty("password").GetValue(user); if (oldPasswordValue != null) { OldPasswordField.SendKeys(oldPasswordValue.ToString()); } NewPasswordField.Click(); var newPasswordValue = user.GetType().GetRuntimeProperty("newPassword").GetValue(user); if (newPasswordValue != null) { NewPasswordField.SendKeys(newPasswordValue.ToString()); } ConfirmPasswordField.Click(); var confirmPasswordValue = user.GetType().GetRuntimeProperty("newPassword").GetValue(user); if (confirmPasswordValue != null) { ConfirmPasswordField.SendKeys(confirmPasswordValue.ToString()); } SaveButton.Click(); }
public void AddTaxRate(TaxRate rate) { Name.SendKeys(rate.Name); Rate.SendKeys(rate.Rate.ToString()); Type.SelectByText(rate.Type); GeoZone.SelectByText(rate.GeoZone); SaveButton.Click(); }
/// <summary> /// Click the "Save" button on the Edit/Create Job Posting page /// </summary> public void ClickSaveButton() { try { BaseWaitForPageToLoad(Driver, 100); SaveButton.Click(); } catch (Exception e) { throw e; } }
public void EditReservationWihoutSelectingDate(int userId) { //Get user e-mail needed for Reservation button locator var currentUser = _userRepository.GetUserById(userId); _userEmail = currentUser.Email.ToString(); EditUserReservationButton.Click(); SaveButton.Click(); }
public void AddInmate(string number) { AddButton.Click(); NameNumberTextBox.Click(); Delay.Seconds(1); NameNumberTextBox.PressKeys(number); NameNumberTextBox.PressKeys("{enter}"); SaveButton.Click(); Delay.Seconds(5); }
/// <summary> /// Changes the Edit Result Type fields to the specified ResultType /// </summary> /// <param name="resultType"></param> public void EditResult(ResultType resultType) { Name.Type(resultType.Name); UoM.Type(resultType.UoM); SetCheckBox(IsDefault, resultType.IsDefault); ReportingPeriod.SelectListOptionByText(resultType.ReportingPeriod.ToString()); System.Threading.Thread.Sleep(1000); //give it a couple seconds to catch up SaveButton.Click(); System.Threading.Thread.Sleep(1000); //give it a couple seconds to save }
/// <summary> /// Method changes name of account. /// </summary> /// <param name="newUserName"></param> public void ChangeUserName(string newUserName) { Wait.Until(t => Driver.FindElements(By.XPath(Locator.UserNameLocator)).Any()); UserName = Driver.FindElement(By.XPath(Locator.UserNameLocator)); UserName.Clear(); UserName.SendKeys(newUserName); Wait.Until(t => Driver.FindElements(By.XPath(Locator.SaveButtonlocator)).Any()); SaveButton = Driver.FindElement(By.XPath(Locator.SaveButtonlocator)); SaveButton.Click(); }
public bool SelectIdea(int ideaId) { SearchFor(ideaId.ToString()); var idea = SearchResults.First(i => i.IdeaId.Equals(ideaId)); SetCheckBox(idea.checkbox, true); bool selected = idea.checkbox.Element.Selected; SaveButton.Click(2); return(selected); }
public void ComposeEmailAndSaveDraft(string addressee, string subject, string body) { Addressee.SendKeys(addressee); Subject.SendKeys(subject); GetDriver().SwitchTo().Frame(EmailBodyFrame); EmailBody.Clear(); EmailBody.Click(); EmailBody.SendKeys(body); GetDriver().SwitchTo().DefaultContent(); SaveButton.Click(); }
public void CreateScreeeningEditButton() { CreateScreeening.Click(); MovieId.SendKeys("2"); DateTime1.SendKeys(RandomDate().ToString("dd/MM/yyyy, 15:15")); CreateButton.Click(); EditCreateScreeningButton.Click(); dateTime1.Clear(); dateTime1.SendKeys(RandomDate().ToString("dd/MM/yyyy HH:00")); SaveButton.Click(); }
//Edit Earn Target on the Profile page public void EditdescriptionOnProfile(string description) { //Click on EditDescription icon driver.WaitForElementIsVisible(EditDescription); EditDescription.Click(); //Enter Description based on Excel data Description.Clear(); Description.SendKeys(description); //Click on save button to save the description SaveButton.Click(); }
public void EditReservationWihoutSelectingTime(int userId) { //Get user e-mail needed for Reservation button locator var currentUser = _userRepository.GetUserById(userId); _userEmail = currentUser.Email.ToString(); EditUserReservationButton.Click(); //Get screening id for current user's reservation for Date drop-down menu locator var currentScreening = _screeningRepository.GetScreeningById(_returnedScreeningId); _userScreeningDate = currentScreening.DateTime.ToString("dd.MM.yyyy"); DateDropDownMenu.Click(); SaveButton.Click(); }
public void Common_methods() { Global.Driver.wait(5); //Click on the Owners tab ServiceSupplier.Click(); //click MyQuote MyQuote.Click(); //Edit EditButton.Click(); //Text Text.Clear(); //enter in text Text2.SendKeys(ExcelLib.ReadData(3, "TestData")); SaveButton.Click(); ServiceSupplier2.Click(); MyQuote2.Click(); }
/// <summary> /// method,where webdriver comes to settings, and paste got before user name /// </summary> /// <param name="newName"></param> public void SettingsNickName(string newName) { Wait.Until(t => Driver.FindElements(By.XPath(Locator.SettingsSelectionPanelLocator)).Any()); Panel = Driver.FindElement(By.XPath(Locator.SettingsSelectionPanelLocator)); Panel.Click(); Wait.Until(t => Driver.FindElements(By.XPath(Locator.PersonalDataButtonLocator)).Any()); PersonalData = Driver.FindElement(By.XPath(Locator.SettingsSelectionPanelLocator)); PersonalData.Click(); Wait.Until(t => Driver.FindElements(By.XPath(Locator.NickNameLocator)).Any()); NewNickName = Driver.FindElement(By.XPath(Locator.NickNameLocator)); NewNickName.SendKeys(newName); Wait.Until(t => Driver.FindElements(By.XPath(Locator.SaveButtonLocator)).Any()); SaveButton = Driver.FindElement(By.XPath(Locator.SaveButtonLocator)); SaveButton.Click(); }
public void CreateBooking(Booking bookingData) { FirstName.SendKeys(bookingData.FirstName); Surname.SendKeys(bookingData.Surname); Price.SendKeys(bookingData.Price.ToString()); DepositPaid.SelectByText(bookingData.Deposit.ToString().ToLower()); CheckIn.SendKeys(bookingData.CheckIn.ToString("yyyy-MM-dd")); CheckOut.SendKeys(bookingData.CheckOut.ToString("yyyy-MM-dd")); int oldBookingcount = bookingListItems.Count(); SaveButton.Click(); var wait = new WebDriverWait(Driver, TimeSpan.FromSeconds(10)); wait.Until(d => FirstName.GetAttribute("value") == "" && bookingListItems.Count() != oldBookingcount ); }
public bool SaveSwitchSpec(string name, string description) { if (name.Length > 8 || name.Length < 1) { throw new ArgumentOutOfRangeException("name length should not greater than 8"); } mainWindow.ActivateWindow(); SaveButton.Click(); bool result = true; Window.HandleModelWindow(saveWin => { var titleText = (wi.TextBox)saveWin.Get(wi.Finders.SearchCriteria.ByAutomationId("6")); var descText = (wi.TextBox)saveWin.Get(wi.Finders.SearchCriteria.ByAutomationId("5")); titleText.SetValue(name); if (description.Length != 0) { descText.SetValue(description); } saveWin.ClickOK(); return(true); }); Window.HandleModelWindow(w => { var desc = w.Get(wi.Finders.SearchCriteria.ByControlType(ControlType.Text)); Console.WriteLine(desc.Name); if (desc.Name.Contains("Exists")) { w.Get(wi.Finders.SearchCriteria.ByText("是(Y)")).Click(); result = true; } else if (desc.Name.Contains("Missing")) { w.Close(); result = false; } return(true); }); return(result); }
// internal void ChangePassword() { //Retrieving new password, confirm password and current passowrd value from excel GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "ChangePassword"); String CurrentPasswordValue = GlobalDefinitions.ExcelLib.ReadData(2, "Password"); String NewPasswordValue = GlobalDefinitions.ExcelLib.ReadData(2, "NewPassword"); String ConfirmPasswordValue = GlobalDefinitions.ExcelLib.ReadData(2, "ConfirmPassword"); //Moving curser to Userwelcom link Actions actions = new Actions(GlobalDefinitions.driver); Thread.Sleep(4000); GenericWait.ElementIsVisible(GlobalDefinitions.driver, "Xpath", "//span[contains(@class,'item ui dropdown link')]", 3); actions.MoveToElement(UserWelcomeLink).Build().Perform(); //Clicking on the change password link GenericWait.ElementIsClickable(GlobalDefinitions.driver, "LinkText", "Change Password", 3); Thread.Sleep(2000); ChangePasswordLink.Click(); //Entering the current password CurrentPasswordTextbox.SendKeys(CurrentPasswordValue); //Entering the new password NewPasswordTextbox.SendKeys(NewPasswordValue); //Entering the confirm password ConfirmPasswordTextbox.SendKeys(ConfirmPasswordValue); //clicking on the save button SaveButton.Click(); string img = SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "Change Password"); //Validating message GlobalDefinitions.MessageValidation("Password Changed Successfully"); }
//Method to create a new rental listing for a property internal bool SaveRentalListing(int TestDataSet) { //Navigate into the "List Rental Property" page NavigateToPage(); try { //Select the property to be listed SelectElement SelectedProperty = new SelectElement(SelectPropertyMenu); //SelectedProperty.SelectByIndex(Convert.ToInt32(ExcelLib.ReadData(TestDataSet, "Property Index"))); SelectedProperty.SelectByText(ExcelLib.ReadData(TestDataSet, "Address")); //Enter test data for the listing TitleTextBox.SendKeys(ExcelLib.ReadData(TestDataSet, "Title")); DescriptionTextArea.SendKeys(ExcelLib.ReadData(TestDataSet, "Description")); MovingCostTextBox.SendKeys(ExcelLib.ReadData(TestDataSet, "Moving Cost")); TargetRentTextBox.SendKeys(ExcelLib.ReadData(TestDataSet, "Target Rent")); AvailableDateDatePicker.SendKeys(ExcelLib.ReadData(TestDataSet, "Available Date")); OccupantsCountTextBox.SendKeys(ExcelLib.ReadData(TestDataSet, "Occupants Count")); //Save the new listing SaveButton.Click(); //Confirm the action of saving a new listing Driver.driver.SwitchTo().Alert().Accept(); return(true); } catch (Exception e) { // Log the error details in the report Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Error, "Error occured when listing a property for rental: " + e.Message.ToString()); // Save Screenshot to display the error String img = SaveScreenShotClass.SaveScreenshot(Driver.driver, "Exception Report"); Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Info, "Image example: " + img); return(false); } }
public NewMessagePage ClickSaveButton() { SaveButton.Click(); return(this); }
//[FindsBy(How = How.XPath, Using = "//*[@id='listing-management-section']/div[2]/div[1]/table/tbody/tr/td[4]")] //private IWebElement ItemToDelete { get; set; } //[FindsBy(How = How.XPath, Using = "")] //private IWebElement { get; set; } //[FindsBy(How = How.XPath, Using = "")] //private IWebElement { get; set; } #endregion internal void AddSkill() { //Populate the Excel sheet Global.GlobalDefinitions.ExcelLib.PopulateInCollection(Global.Base.ExcelPath, "Skill"); ShareSkillBtn.Click(); Global.GlobalDefinitions.wait(5); TitleTextbox.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Title")); DescriptionTextbox.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Description")); CategoryDropdown.Click(); var category = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='service-listing-section']/div[2]/div/form/div[3]/div[2]/div/div/select")); var selectElement = new SelectElement(category); selectElement.SelectByIndex(3); SubcategoryDropdown.Click(); var subcategory = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='service-listing-section']/div[2]/div/form/div[3]/div[2]/div/div[2]/div[1]/select")); var selectElement1 = new SelectElement(subcategory); selectElement1.SelectByIndex(3); TagsTextbox.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "Tags")); TagsTextbox.SendKeys(Keys.Enter); TagsTextbox1.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(3, "Tags")); TagsTextbox1.SendKeys(Keys.Enter); OneoffService.Click(); Thread.Sleep(500); HourlyService.Click(); Thread.Sleep(500); OnSite.Click(); Thread.Sleep(500); Online.Click(); StartdateTextbox.Click(); StartdateTextbox.SendKeys(DateTime.Now.AddDays(5).ToString("dd/MM/yyyy")); EnddateTextbox.Click(); EnddateTextbox.SendKeys(DateTime.Now.AddMonths(1).ToString("dd/MM/yyyy")); SunCheckBox.Click(); SunStartTime.Click(); SunStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartHour")); SunStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartMinutes")); SunStartTime.SendKeys(Keys.Up); SunEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndHour")); SunEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndMinutes")); SunEndTime.SendKeys(Keys.ArrowDown); MonCheckBox.Click(); MonStartTime.Click(); MonStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartHour")); MonStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartMinutes")); MonStartTime.SendKeys(Keys.Up); MonEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndHour")); MonEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndMinutes")); MonEndTime.SendKeys(Keys.ArrowDown); TueCheckBox.Click(); TueStartTime.Click(); TueStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartHour")); TueStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartMinutes")); TueStartTime.SendKeys(Keys.Up); TueEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndHour")); TueEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndMinutes")); TueEndTime.SendKeys(Keys.ArrowDown); WedCheckBox.Click(); WedStartTime.Click(); WedStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartHour")); WedStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartMinutes")); WedStartTime.SendKeys(Keys.Up); WedEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndHour")); WedEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndMinutes")); WedEndTime.SendKeys(Keys.ArrowDown); ThuCheckBox.Click(); ThuStartTime.Click(); ThuStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartHour")); ThuStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartMinutes")); ThuStartTime.SendKeys(Keys.Up); ThuEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndHour")); ThuEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndMinutes")); ThuEndTime.SendKeys(Keys.ArrowDown); FriCheckBox.Click(); FriStartTime.Click(); FriStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartHour")); FriStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartMinutes")); FriStartTime.SendKeys(Keys.Up); FriEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndHour")); FriEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndMinutes")); FriEndTime.SendKeys(Keys.ArrowDown); SatCheckBox.Click(); SatStartTime.Click(); SatStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartHour")); SatStartTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "StartMinutes")); SatStartTime.SendKeys(Keys.Up); SatEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndHour")); SatEndTime.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "EndMinutes")); SatEndTime.SendKeys(Keys.ArrowDown); SkillExchangeButton.Click(); SkillExchangeTag.Click(); SkillExchangeTag.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "SkillToExchange")); SkillExchangeTag.SendKeys(Keys.Enter); CreditButton.Click(); CreditAmount.Click(); CreditAmount.SendKeys(Global.GlobalDefinitions.ExcelLib.ReadData(2, "CreditAmount")); PlusCircleIcon.Click(); //Upload file AutoItX3 autoIt = new AutoItX3(); autoIt.WinActivate("Open"); autoIt.Send(@"C:\Users\Nemesis\Pictures\TanslatePix\zodiac.jpg"); Thread.Sleep(500); autoIt.Send("{ENTER}"); Thread.Sleep(500); PlusCircleIcon.Click(); AutoItX3 autoIt1 = new AutoItX3(); autoIt1.WinActivate("Open"); Thread.Sleep(500); autoIt1.Send(@"C:\Users\Nemesis\Pictures\TanslatePix\doggie.jpg"); Thread.Sleep(500); autoIt1.Send("{ENTER}"); Thread.Sleep(500); RemoveItem.Click(); HiddenRadioButton.Click(); Thread.Sleep(1000); ActiveRadioButton.Click(); SaveButton.Click(); Global.GlobalDefinitions.wait(5); //Add Skill Verification ManageListingsTab.Click(); Global.GlobalDefinitions.wait(5); string ExpectedText = Global.GlobalDefinitions.ExcelLib.ReadData(2, "Description"); string ActualText = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/table/tbody/tr/td[4]")).Text; if (ExpectedText.Equals(ActualText)) { Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Add Skill Successful"); String img = SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "AddSkill_Pass"); test.Log(LogStatus.Info, "Image example: " + img); } else { Global.Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Add Skill UnSuccessful"); String img1 = SaveScreenShotClass.SaveScreenshot(GlobalDefinitions.driver, "AddSkill_Fail"); test.Log(LogStatus.Info, "Image example: " + img1); } }
public IndexPage click_save() { SaveButton.Click(); return(new IndexPage(_driver)); }
public ServiceEndpointsScreen TapSaveButton() { SaveButton.Click(); return(new ServiceEndpointsScreen(Driver)); }
//Click save button internal void SaveProperty() { SaveButton.Click(); }
public void ClickSave() { SaveButton.Click(); }
//Click Save button and send the request internal void SaveRequest() { SaveButton.Click(); }
public void ClickSave(MainPage MainPageInstance, WebDriverWait wait, IWebDriver driver) { SaveButton.Click(); wait.Until((d) => MainPageInstance.CenterContainer.ScheduleContent.IsOpened(driver)); }