public void Enter_Value_ListARentalPage() { // var SelectElement = new SelectElement(SelectProp); // SelectElement.SelectByIndex(1); Actions actions = new Actions(_driver); actions.MoveToElement(SelectProp); actions.Click(); actions.SendKeys("1222 High Street, Taita, Lower Hutt, 5011"); actions.Build().Perform(); System.Threading.Thread.Sleep(200); Title.SendKeys("TestTitleNewToRent"); Description.SendKeys("Description To Test"); MovingCost.SendKeys("2000"); TargetRent.SendKeys("200"); AvailableDate.Click(); AvailableDate.Clear(); AvailableDate.SendKeys("16/07/2019"); System.Threading.Thread.Sleep(250); OccupantsCount.SendKeys("2"); UploadPhoto.SendKeys(@"C:\Users\Mallik\Documents\Key-Project\property-connect-home.jpg"); System.Threading.Thread.Sleep(150); Save.Click(); _Wait.Until(condition: ExpectedConditions.ElementExists(By.Id("SearchBox"))); // IAlert alert = _driver.SwitchTo().Alert(); // alert.Accept(); // System.Threading.Thread.Sleep(50); }
internal void ListAsRental() { //Populate excel file ExcelLib.PopulateInCollection(Config.Keys_Resource.ExcelPath, "ListRental"); Thread.Sleep(1000); //calling the common methods Common_methods(); Thread.Sleep(500); //Select properties page PropertiesPage.Click(); //Clicking on save button ListaRental.Click(); Driver.wait(2000); //Enter Title Title.SendKeys(ExcelLib.ReadData(2, "Title")); Driver.wait(2000); //Enter moving cost MovingCost.SendKeys(ExcelLib.ReadData(2, "MovingCost")); Driver.wait(2000); //Enter List Description ListDescription.SendKeys(ExcelLib.ReadData(2, "Description")); Driver.wait(2000); //Enter List target rent ListTargetRent.SendKeys(ExcelLib.ReadData(2, "TargetRent")); Driver.wait(2000); //Enter Available date AvailableDate.Clear(); Driver.wait(500); AvailableDate.SendKeys("31/08/2018"); Driver.wait(2000); //Enter Occupant Count OccupantCount.SendKeys(ExcelLib.ReadData(2, "Occupants")); Driver.wait(2000); //Upload a file thru AutoIT Driver.wait(1000); AutoItX3 autoIT = new AutoItX3(); Uploadingfile.Click(); autoIT.WinActivate("Open"); Thread.Sleep(1000); autoIT.Send(@"C:\Users\VictorFelix\source\repos\automationOnboardingSample-master\Keys_Onboarding\TestReports\Screenshots\home.jpg"); Thread.Sleep(1000); autoIT.Send("{Enter}"); Thread.Sleep(1000); //Clicking on Save ListSave.Click(); Driver.wait(2000); //Clicking on OK on Alert //Driver.driver.SwitchTo().Alert().Accept(); //Driver.wait(2000); //Click on the Owners tab Ownertab.Click(); Thread.Sleep(1000); //Click on the Rental Listings button RentalListings.Click(); Thread.Sleep(1000); //Search for added list property SearchBox.SendKeys(ExcelLib.ReadData(2, "Title")); Driver.wait(2000); //Clicking on Search icon SearchBtn.Click(); Driver.wait(2000); }