Skip to content

Instantly share code, notes, and snippets.

@johnmmoss
Created March 13, 2015 16:20
Show Gist options
  • Save johnmmoss/dbdcc6f9a986fa401787 to your computer and use it in GitHub Desktop.
Save johnmmoss/dbdcc6f9a986fa401787 to your computer and use it in GitHub Desktop.
Selenium API submitting a form
// Find the submit button and click it
webDriver.FindElement(By.Id("CreateButton")).Click();
// Find the form by its tag and submit it
webDriver.FindElement(By.TagName("form")).Submit();
// Call submit on the element, it automatically submits the form
var descriptionElement = webDriver.FindElement(By.Id("Name"));
descriptionElement.Clear();
descriptionElement.SendKeys(description);
descriptionElement.Submit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment