コード例 #1
0
 public void enterName(String name)
 {
     quality.Type("id=name", name);
     //this.name.Clear();
     //this.name.SendKeys(name);
     //customer.setName(name);
 }
コード例 #2
0
 public void enterCardHolderName(string name)
 {
     quality.Type("cardHolderName", name);
     //cardHolderName = driver.UnderlyingWebDriver.FindElement(By.Name("cardHolderName"));
     //this.cardHolderName.SendKeys(name);
 }
コード例 #3
0
        /// <summary>
        /// Creates a new username based on the time of day
        /// </summary>
        /// <param name="password">desired password to use</param>
        /// <param name="quality">Instance of the quality check</param>
        /// <returns>The username that was created</returns>
        public string CreateUser(string password)
        {
            string username;
            string windowtitle;

            username = "******" + System.DateTime.Now.TimeOfDay.TotalMinutes;

            /*
             * if (selenium.IsTextPresent("You are signed in as"))
             * {
             *  selenium.Click("id=signOutLink");
             *  selenium.WaitForPageToLoad("30000");
             * }
             */
            quality.Click("id=headerSignInLink");
            selenium.WaitForPageToLoad("30000");
            windowtitle = selenium.UnderlyingWebDriver.Title;

            quality.Click("link=Create your free account");
            Thread.Sleep(3000);

            quality.Type("id=registration:fullNameDecoration:fullName", "Automated Tester");
            quality.Type("id=registration:emailDecoration:email", username + "@fake.com");
            quality.Type("id=registration:usernameDecoration:username", username);
            quality.Type("id=registration:passwordDecoration:password", password);
            quality.Type("id=registration:passwordConfirmDecoration:passwordConfirm", password);
            quality.Type("id=registration:displayNameDecoration:displayName", username);
            //quality.Click("id=registration:myGarminTerms");
            //quality.Click("id=registration:connectTerms");
            quality.Click("id=registration:submitButton");
            quality.WaitForPageToLoad("30000");

            /*
             * quality.SelectWindow("Create An Account");
             *
             * quality.Type("id=name", "automated tester");
             * quality.Type("id=email", username + "@fake.com");
             * quality.Type("id=username", username);
             * quality.Type("id=password", password);
             * quality.Type("id=passwordMatch", password);
             * Thread.Sleep(1000);
             * quality.Click("id=submitBtn");
             * Thread.Sleep(6000);
             * //selenium.WaitForPageToLoad("30000");
             * quality.SelectWindow("Garmin Connect - Register");
             * quality.Type("id=userRegistrationException:displayName", username);
             * quality.Click("id=userRegistrationException:submitButton");
             */
            quality.IsTextPresent(username);

            return(username);
        }