コード例 #1
0
        public void UserRegistration(string firstName, string lastName, string email, string password, string gender,
                                     string country)
        {
            email = email.Replace("_random", Guid.NewGuid().ToString());
            FirstNameTextBox.SendKeys(firstName);
            LastNameTextBox.SendKeys(lastName);
            EmailTextBox.SendKeys(email);
            PasswordTextBox.SendKeys(password);
            foreach (var genderBtn in GenderRadioButton)
            {
                var genderValue = genderBtn.GetAttribute("value");
                if (genderValue == gender)
                {
                    genderBtn.Click();
                    break;
                }
            }

            var countrySelect = new SelectElement(CountrySelectBox);

            countrySelect.SelectByText(country);


            DriverWait.Until(ExpectedConditions.ElementToBeClickable(SignupButton)).SendKeys(Keys.Enter);
        }
コード例 #2
0
        public void FillSupportForm()
        {
            //ComboBoxHelper.SelectElement(EnquiryReasonDropDown, value);
            var modelFaker = new Faker <DataModel>()
                             .RuleFor(o => o.firstName, f => f.Name.FirstName())
                             .RuleFor(o => o.lastName, f => f.Name.LastName())
                             .RuleFor(o => o.emailAddress, f => f.Internet.Email())
                             .RuleFor(o => o.phoneNumber, f => f.Phone.PhoneNumber())
                             .RuleFor(o => o.websiteUrl, f => f.Internet.Url())
                             .RuleFor(o => o.company, f => f.Company.CompanyName())
                             .RuleFor(o => o.reason, f => f.PickRandom <Reason>())
                             .RuleFor(o => o.message, f => f.Lorem.Sentence());


            var    dataModel    = modelFaker.Generate();
            string firstName    = dataModel.firstName;
            string lastName     = dataModel.lastName;
            string emailAddress = dataModel.emailAddress;
            string phoneNumber  = dataModel.phoneNumber;
            string websiteurl   = dataModel.websiteUrl;
            string company      = dataModel.company;
            string reason       = dataModel.reason.ToString();
            string message      = dataModel.message;

            FirstNameTextBox.SendKeys(firstName);
            LastNameTextBox.SendKeys(lastName);
            EmailAddressTextBox.SendKeys(emailAddress);
            PhoneNumberTextBox.SendKeys(phoneNumber);
            WebsiteUrlTextBox.SendKeys(websiteurl);
            CompanyTextBox.SendKeys(company);
            EnquiryReasonDropDown.SendKeys(reason);
            MessageTextBox.SendKeys(message);
        }
コード例 #3
0
        public void FillRegisterForm(User user, string takeaction = "save")
        {
            FirstNameTextBox.SendKeys(user.FirstName);
            LastNameTextBox.SendKeys(user.LastName);
            PasswordTextBox.SendKeys(user.Password);
            AliasAddressTextBox.SendKeys(user.AliasAddress);
            AddressTextBox.SendKeys(user.Address);
            CityTextBox.SendKeys(user.City);
            ZipCodeTextBox.SendKeys(user.ZipCode);
            CountryDropdown.SelectByText(user.Country);
            StateDropdown.SelectByText(user.State);
            MobilePhoneTextBox.SendKeys(user.MobilePhone);
            SelectDateOfBirth(user.DateOfBirth);

            if (takeaction == "save")
            {
                RegisterButton.Click();
            }
        }
 /// <summary>
 /// Enter a value into the 'First Name' field
 /// </summary>
 /// <param name="firstName">The value to enter</param>
 public void EnterFirstName(string firstName)
 {
     FirstNameTextBox.Clear();
     FirstNameTextBox.SendKeys(firstName);
 }