示例#1
0
        public int Submit(IWebDriver driver, Abstract.Environment environment)
        {
            environment.NavigateTo(driver, Url);

            foreach (var keyPair in this)
            {
                var element = driver.FindElement(By.Id(keyPair.Key));
                element.SendKeys(keyPair.Value);
            }

            var form = driver.FindElement(By.Id(_formElementId));

            form.Submit();

            switch (KeySource)
            {
            case InsertedKeySource.None:
                return(0);

            case InsertedKeySource.UrlEnd:
                return(int.Parse(driver.Url.Split('/').Last()));
            }

            throw new NotImplementedException();
        }
示例#2
0
        protected void Login(IWebDriver driver, Abstract.Environment env, Credentials login)
        {
            var form = login.MapToForm(LoginForm());

            form.Submit(driver, env);
        }
示例#3
0
 protected void Login(IWebDriver driver, Abstract.Environment env)
 {
     Login(driver, env, env.DefaultCredentials());
 }