示例#1
0
        public string RegisterUserAccount(RegistrationUser user)
        {
            //first name
            FirstName.Clear();
            FirstName.SendKeys(user.FirstName);

            //last name
            LastName.Clear();
            LastName.SendKeys(user.LastName);

            //password
            Password.Clear();
            Password.SendKeys(user.Password);

            //mail
            Mail.Clear();
            Mail.SendKeys(user.Mail);

            //address first name
            Address_FirstName.Clear();
            Address_FirstName.SendKeys(user.Address.FirstName);

            //address last name
            Address_LastName.Clear();
            Address_LastName.SendKeys(user.Address.LastName);

            //address1
            Address_Address.Clear();
            Address_Address.SendKeys(user.Address.Address1);

            //city
            Address_City.Clear();
            Address_City.SendKeys(user.Address.City);

            //state
            Address_State.SendKeys(user.Address.State + Keys.Enter);

            //zipcode
            Address_ZipCode.Clear();
            Address_ZipCode.SendKeys(user.Address.Zipcode);

            //country
            Address_Country.SendKeys(user.Address.Country + Keys.Enter);

            //mobilephone
            Address_MobilePhone.Clear();
            Address_MobilePhone.SendKeys(user.Address.MobilePhone);
            //alias
            Address_AdressAlias.Clear();
            Address_AdressAlias.SendKeys(user.Address.Alias);

            RegisterUser_Button.Click();

            return(ErrorText.Text);
        }
示例#2
0
 public void FillForm(RegistrationUser user)
 {
     RadioButton.Click();
     FirstName.SendKeys(user.FirstName);
     LastName.SendKeys(user.LastName);
     Email.Clear();
     Email.SendKeys(user.Email);
     Password.SendKeys(user.Password);
     DaysOption.SelectByIndex(user.DateOfBirth.Day);
     MonthsOption.SelectByIndex(user.DateOfBirth.Month);
     YearsOption.SelectByValue(user.DateOfBirth.Year.ToString());
     SignUpNewsletter.Click();
     Address_FirstName.SendKeys(user.Address.FirstName);
     Address_LastName.SendKeys(user.Address.LastName);
     Address_Address1.SendKeys(user.Address.Address1);
     Address_City.SendKeys(user.Address.City);
     StateOption.SelectByText(user.Address.State);
     Address_ZipCode.SendKeys(user.Address.ZipCode.ToString());
     CountryOption.SelectByText(user.Address.Country);
     Address_Info.SendKeys(user.Address.Info);
     Address_MobPhone.SendKeys(user.Address.MobPhone);
     RegisterButton.Click();
 }