Exemple #1
0
        public void CreateAccount(User user)
        {
            new WebDriverWait(Driver.driver, TimeSpan.FromSeconds(5)).Until(ExpectedConditions.ElementIsVisible(By.Id("uniform-id_gender1")));
            if (user.Title.Equals("Mr."))
            {
                TitleMaleRadioBtn.Click();
            }
            else
            {
                TitleFemaleRadioBtn.Click();
            }

            FirstNameInput.SendKeys(user.FirstName);
            LastNameInput.SendKeys(user.LastName);
            PasswordInput.SendKeys(user.Password);
            var daysSelectElement = new SelectElement(DaysDropdown);

            daysSelectElement.SelectByValue(user.DateBirth.Day.ToString());
            var monthsSelectElement = new SelectElement(MonthsDropdown);

            monthsSelectElement.SelectByValue(user.DateBirth.Month.ToString());
            var yearsSelectElement = new SelectElement(YearsDropdown);

            yearsSelectElement.SelectByValue(user.DateBirth.Year.ToString());
            CityInput.SendKeys(user.City);
            var stateSelectElement = new SelectElement(StateDropDown);

            stateSelectElement.SelectByText(user.State);
            ZipPostalCode.SendKeys(user.ZipCode.ToString());
            var countrySelectElement = new SelectElement(CountryDropDown);

            countrySelectElement.SelectByText(user.Country);
            AddressInput.SendKeys(user.Address);
            MobilePhoneInput.SendKeys(user.MobilePhone.ToString());
            AliasAddressInput.SendKeys(user.AddressAlias);

            DataGenerator.AddMoreUsersToCsvFile(user);
        }