I would like to use Selenium to submit a form which contains several elements. For example:
Store the form element in a variable, then use it as the search context to find the child elements:
WebElement formElement = driver.findElement(By.name("something"));
WebElement a = formElement.findElement(By.name("a"));
WebElement b = formElement.findElement(By.name("b"));
WebElement c = formElement.findElement(By.name("c"));
a.sendKeys("first child element [a]");
b.sendKeys("password");
c.submit();