public CheckoutOverview AddInformation(CheckoutPageBO addInformationCheckoutBO) { TxtFirstName.SendKeys(addInformationCheckoutBO.FirstName); TxtLastName.SendKeys(addInformationCheckoutBO.LastName); TxtZipCode.SendKeys(addInformationCheckoutBO.ZipCode); BtnContinue.Click(); return(new CheckoutOverview(driver)); }
public ChackoutOverveaw AddInformation(CheckoutPageBO addInformationCheckoutBO) { TxtFirstName.SendKeys(addInformationCheckoutBO.FirstName); TxtLastName.SendKeys(addInformationCheckoutBO.LastName); TxtZipCode.SendKeys(addInformationCheckoutBO.ZipCode); BtnContinue.Click(); return(new ChackoutOverveaw(driver)); //btn_action cart_button - class name pentru butonul de finish }
public AddressDetailsPage.AddressDetailsPage AddAddress(AddAddressBO addAddressBo) { TxtFirstName.SendKeys(addAddressBo.FirstName); TxtLastName.SendKeys(addAddressBo.LastName); TxtAddress1.SendKeys(addAddressBo.Address1); TxtCity.SendKeys(addAddressBo.City); var selectState = new SelectElement(DdlState); selectState.SelectByText(addAddressBo.State); TxtZipCode.SendKeys(addAddressBo.ZipCode); LstCountry[addAddressBo.Country].Click(); var js = (IJavaScriptExecutor)driver; js.ExecuteScript("arguments[0].setAttribute('value', arguments[1])", BtnColor, addAddressBo.Color); BtnCreateAddress.Click(); return(new AddressDetailsPage.AddressDetailsPage(driver)); }
//method to fill register form public IWebElement Register(string fname, string lname, int date, string month, int year, string email, string passwrd) { TxtFirstName.SendKeys(fname); TxtLastName.SendKeys(lname); SelectDay.SendKeys(date.ToString()); SelectMonth.SendKeys(month); SelectYear.SendKeys(year.ToString()); TxtEmail.SendKeys(email); TxtPasswrd.SendKeys(passwrd); TxtConfirmPasswrd.SendKeys(passwrd); BtnRegister.Click(); Console.WriteLine("Registering using MyAccountPage.Register"); try { BtnContinue = PropertiesCollection.Driver.FindElement(By.Name("register-continue")); } catch (OpenQA.Selenium.NoSuchElementException) { BtnContinue = null; } Console.WriteLine(BtnContinue); return(BtnContinue); }
internal void AddTenantMethod() { try { ExcelLib.PopulateInCollection(Base.ExcelPath, "TenantDetails"); if (Driver.driver.PageSource.Contains("Add Tenant")) { LnqTenantAddress.Click(); Thread.Sleep(3000); bool bEmail = TxtTenantEmail.Enabled; if (bEmail) { TxtTenantEmail.SendKeys(ExcelLib.ReadData(3, "EmailId")); Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Email Id field is enabled and value from excel sheet passed"); IsMainTenant.Click(); Thread.Sleep(3000); bool bFName = TxtFirstName.Enabled; if (bFName) { TxtFirstName.SendKeys(ExcelLib.ReadData(3, "FirstName")); TxtLastName.SendKeys(ExcelLib.ReadData(3, "LastName")); Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Info, "Its a new email id; First Name and Last name filled with Excel sheet"); // DtRentStartDate.Click(); //DtRentStartDate.Clear(); //DtRentStartDate.SendKeys(ExcelLib.ReadData(3, "StartDate")); } else { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Info, "First Name & Last Name has been auto filled with the email id"); } Driver.wait(7); DtRentStartDate.Click(); bool bRentField = TxtRentAmount.Enabled; if (bRentField) { TxtRentAmount.SendKeys(ExcelLib.ReadData(3, "RentAmount")); decimal d; if (decimal.TryParse(ExcelLib.ReadData(3, "RentAmount"), out d)) { DDLPayFrequency.Click(); Thread.Sleep(2000); Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Rent Amount field has been verified for decimal values"); DtPayStartDate.Click(); //DtPayStartDate.Clear(); //DtPayStartDate.SendKeys(ExcelLib.ReadData(3, "PaymentStartDate")); DDLPayDuedate.Click(); if (BtnAddTenantNext.Enabled) { BtnAddTenantNext.Click(); Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "All the field has been entered on Add Tenant page"); } else { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Some of the fields on Add tenant Page need sto be cross verified, Next button is not enabled "); } } else { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Rent Amount field has been verified for decimal values"); } } else { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Rent amount field is not enabled"); } } else { Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Email Id Field is not enabled"); } } } catch (Exception ex) { string excepMessage = ex.Message; Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, excepMessage); } }