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(); }
protected void Login(IWebDriver driver, Abstract.Environment env, Credentials login) { var form = login.MapToForm(LoginForm()); form.Submit(driver, env); }
protected void Login(IWebDriver driver, Abstract.Environment env) { Login(driver, env, env.DefaultCredentials()); }